[libc++] Add missing XFAIL to tests that need __atomic_* libcalls
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Fri, 8 Jan 2021 11:54:43 +0000 (11:54 +0000)
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Fri, 8 Jan 2021 12:48:22 +0000 (12:48 +0000)
FreeBSD did not provide the __atomic_* functions as part of the base
system until recently. They were added to libgcc_s in SVN revision r364753
(August 2020), so check for availability of 'non-lockfree-atomics' so that
these tests do not fail unexpectedly on older versions of FreeBSD.

This also removes the #ifndef __APPLE__ from atomic_helpers.h that was used
to work around lack of atomic runtime functions on older Apple platforms
and replaces it with XFAIL: !non-lockfree-atomics.

Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D88818

14 files changed:
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_helpers.h
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp

index 9c21ada..40514f0 100644 (file)
@@ -106,13 +106,14 @@ struct TestEachAtomicType {
     void operator()() const {
         TestEachIntegralType<TestFunctor>()();
         TestFunctor<UserAtomicType>()();
-#ifndef __APPLE__
         /*
-            These aren't going to be lock-free,
-            so some libatomic.a is necessary.
+            Note: These aren't going to be lock-free,
+            so some libatomic.a is necessary. To handle
+            the case where the support functions are
+            missing, all tests that use this file should add:
+            XFAIL: !non-lockfree-atomics
         */
         TestFunctor<LargeUserAtomicType>()();
-#endif
 /*
     Enable these once we have P0528 
     
index 285e1af..60a1248 100644 (file)
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 //
 // UNSUPPORTED: libcpp-has-no-threads
+// XFAIL: !non-lockfree-atomics
 //  ... assertion fails line 36
 
 // <atomic>
index da0b955..49d2173 100644 (file)
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 //
 // UNSUPPORTED: libcpp-has-no-threads
+// XFAIL: !non-lockfree-atomics
 //  ... assertion fails line 35
 
 // <atomic>