diff --git a/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp b/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp index 222c6d026fc0f..42a7c08fa75ba 100644 --- a/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp +++ b/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp @@ -6,9 +6,8 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // static constexpr bool is_always_lock_free = implementation-defined; // bool is_lock_free() const volatile noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp index 3bdd8ae792cf7..3daf3aba71fc9 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/assign.pass.cpp @@ -6,9 +6,8 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // floating-point-type operator=(floating-point-type) volatile noexcept; // floating-point-type operator=(floating-point-type) noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp index b9e2fe40f955f..b010e7c7a4d79 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_strong.pass.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // bool compare_exchange_strong(T& expected, T desired, // memory_order success, memory_order failure) volatile noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp index f3ac52ff28cfe..27853ef08c748 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/compare_exchange_weak.pass.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // bool compare_exchange_weak(T& expected, T desired, // memory_order success, memory_order failure) volatile noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp index d2f4a2bd64dc0..aad6354084761 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/ctor.pass.cpp @@ -6,9 +6,8 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // constexpr atomic() noexcept; // constexpr atomic(floating-point-type) noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp index 1807e48f7befb..9c67d7e671cfa 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/exchange.pass.cpp @@ -6,12 +6,11 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu // Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893 -// XFAIL: tsan +// XFAIL: target={{x86_64-.*}} && tsan // XFAIL: target={{x86_64-.*}} && msan -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // T exchange(T, memory_order = memory_order::seq_cst) volatile noexcept; // T exchange(T, memory_order = memory_order::seq_cst) noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp index a73c5f26b71f6..664185fc243f9 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp @@ -6,14 +6,13 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu -// XFAIL: LIBCXX-AIX-FIXME +// UNSUPPORTED: LIBCXX-AIX-FIXME // Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893 -// XFAIL: tsan +// XFAIL: target={{x86_64-.*}} && tsan // Hangs with msan. // UNSUPPORTED: msan -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // floating-point-type fetch_add(floating-point-type, // memory_order = memory_order::seq_cst) volatile noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp index d21a42e53a546..c4e33538de741 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp @@ -6,14 +6,13 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu -// XFAIL: LIBCXX-AIX-FIXME +// UNSUPPORTED: LIBCXX-AIX-FIXME // Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893 -// XFAIL: tsan +// XFAIL: target={{x86_64-.*}} && tsan // Hangs with msan. // UNSUPPORTED: msan -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // floating-point-type fetch_sub(floating-point-type, // memory_order = memory_order::seq_cst) volatile noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp index 2901af0a7f39d..b495d04989e20 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/load.pass.cpp @@ -6,11 +6,10 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu // Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893 -// XFAIL: tsan -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// XFAIL: target={{x86_64-.*}} && tsan +// UNSUPPORTED: !non-lockfree-atomics // floating-point-type load(memory_order = memory_order::seq_cst) volatile noexcept; // floating-point-type load(memory_order = memory_order::seq_cst) noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp index 7619d113a3408..b5422c0362dc1 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp @@ -6,9 +6,8 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // static constexpr bool is_always_lock_free = implementation-defined; // bool is_lock_free() const volatile noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp index 143a034c55b7f..eca7a19e5c57d 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_all.pass.cpp @@ -8,8 +8,8 @@ // UNSUPPORTED: no-threads // XFAIL: availability-synchronization_library-missing // UNSUPPORTED: c++03, c++11, c++14, c++17 -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // void notify_all() volatile noexcept; // void notify_all() noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp index debc9ddcdd328..183cf18b820e7 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/notify_one.pass.cpp @@ -8,8 +8,8 @@ // UNSUPPORTED: no-threads // XFAIL: availability-synchronization_library-missing // UNSUPPORTED: c++03, c++11, c++14, c++17 -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // void notify_one() volatile noexcept; // void notify_one() noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp index e0da122c3059b..58c8da6c1042b 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.float.pass.cpp @@ -6,9 +6,8 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // operator floating-point-type() volatile noexcept; // operator floating-point-type() noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp index 0ee0232718afa..b1ef276d870cf 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp @@ -6,10 +6,9 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu -// XFAIL: LIBCXX-AIX-FIXME -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: LIBCXX-AIX-FIXME +// UNSUPPORTED: !non-lockfree-atomics // Hangs with msan. // UNSUPPORTED: msan diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp index 1cdafaa4b5ab8..0b1781bf8e571 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp @@ -6,10 +6,9 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: target={{.+}}-windows-gnu -// XFAIL: LIBCXX-AIX-FIXME -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: LIBCXX-AIX-FIXME +// UNSUPPORTED: !non-lockfree-atomics // Hangs with msan. // UNSUPPORTED: msan diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp index 957dbbe0d876e..81d17cd32a6c5 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp @@ -7,9 +7,9 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893 -// XFAIL: tsan -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// XFAIL: target={{x86_64-.*}} && tsan +// UNSUPPORTED: !non-lockfree-atomics // void store(floating-point-type, memory_order = memory_order::seq_cst) volatile noexcept; // void store(floating-point-type, memory_order = memory_order::seq_cst) noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp index 6c4f65d3bc386..d95801e25d35e 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/wait.pass.cpp @@ -8,10 +8,10 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // XFAIL: availability-synchronization_library-missing // Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893 -// XFAIL: tsan +// XFAIL: target={{x86_64-.*}} && tsan // XFAIL: target={{x86_64-.*}} && msan -// ADDITIONAL_COMPILE_FLAGS(has-latomic): -latomic // XFAIL: !has-64-bit-atomics +// UNSUPPORTED: !non-lockfree-atomics // void wait(T old, memory_order order = memory_order::seq_cst) const volatile noexcept; // void wait(T old, memory_order order = memory_order::seq_cst) const noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp index e446bcf5cfc97..2c8ce34530302 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp @@ -40,8 +40,10 @@ struct TestFn { A a(T(1)); static_assert(noexcept(std::atomic_notify_all(&a)), ""); - std::atomic is_ready[2] = {false, false}; - auto f = [&](int index) { + std::atomic is_ready[2]; + is_ready[0] = false; + is_ready[1] = false; + auto f = [&](int index) { assert(std::atomic_load(&a) == T(1)); is_ready[index].store(true); @@ -63,8 +65,10 @@ struct TestFn { volatile A a(T(2)); static_assert(noexcept(std::atomic_notify_all(&a)), ""); - std::atomic is_ready[2] = {false, false}; - auto f = [&](int index) { + std::atomic is_ready[2]; + is_ready[0] = false; + is_ready[1] = false; + auto f = [&](int index) { assert(std::atomic_load(&a) == T(2)); is_ready[index].store(true); diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py index ab5a24dadb605..ccabb48833f10 100644 --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -169,14 +169,11 @@ def _getAndroidDeviceApi(cfg): when=lambda cfg: hasCompileFlag(cfg, "-Xclang -verify-ignore-unexpected"), ), Feature( - name="has-latomic", + name="add-latomic-workaround", # https://github.com/llvm/llvm-project/issues/73361 when=lambda cfg: sourceBuilds( - cfg, - """ - int main(int, char**) { return 0; } - """, - ["-latomic"], + cfg, "int main(int, char**) { return 0; }", ["-latomic"] ), + actions=[AddLinkFlag("-latomic")], ), Feature( name="non-lockfree-atomics",