[libcxx] r350772 - [NFC] Always lock free test: add indirection

JF Bastien jfbastien at apple.com
Wed Jan 9 15:20:24 PST 2019


Author: jfb
Date: Wed Jan  9 15:20:24 2019
New Revision: 350772

URL: http://llvm.org/viewvc/llvm-project?rev=350772&view=rev
Log:
[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]

Modified:
    libcxx/trunk/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp

Modified: libcxx/trunk/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp?rev=350772&r1=350771&r2=350772&view=diff
==============================================================================
--- libcxx/trunk/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp (original)
+++ libcxx/trunk/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp Wed Jan  9 15:20:24 2019
@@ -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(); }




More information about the libcxx-commits mailing list