[NFC] Always lock free test: add indirection

I have a big patch coming up, and this indirection is required to avoid hitting the following after my big change:

  error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]

llvm-svn: 350772
This commit is contained in:
JF Bastien 2019-01-09 23:20:24 +00:00
parent 569f090922
commit 1026ce6de4

View File

@ -59,7 +59,7 @@ void checkLongLongTypes() {
static_assert((0 != ATOMIC_LLONG_LOCK_FREE) == ExpectLockFree, "");
}
int main()
void run()
{
// structs and unions can't be defined in the template invocation.
// Work around this with a typedef.
@ -134,3 +134,5 @@ int main()
static_assert(std::atomic<void*>::is_always_lock_free == (2 == ATOMIC_POINTER_LOCK_FREE));
static_assert(std::atomic<std::nullptr_t>::is_always_lock_free == (2 == ATOMIC_POINTER_LOCK_FREE));
}
int main() { run(); }