From cc9d10810ea3785ca5fcbb5fee6845f51b4b7737 Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Thu, 14 Dec 2023 17:16:34 -0800 Subject: [PATCH 1/3] [libc++][NFC] Simplify features for detecting atomics' support. `non-lockfree-atomics` is very similar to `has-64-bit-atomics`; to simplify, we can have uniform features for atomic types of increasing sizes (`has-128-bit-atomics`, `has-256-bit-atomics`, etc.). `is-lockfree-runtime-function` feature was a workaround for the partial support for large atomic types on older versions of macOS (see https://reviews.llvm.org/D91911). While we still support macOS 10.14, conceptually it's simpler to check for support for all the atomic functionality inside the `has-*-atomics` features, and the workaround is no longer worth the maintenance cost. --- .../atomics/atomics.align/align.pass.cpp | 2 +- .../atomics.types.float/lockfree.pass.cpp | 1 - .../atomics.types.float/assign.pass.cpp | 1 - .../compare_exchange_strong.pass.cpp | 1 - .../compare_exchange_weak.pass.cpp | 1 - .../atomics.types.float/ctor.pass.cpp | 1 - .../atomics.types.float/exchange.pass.cpp | 1 - .../atomics.types.float/fetch_add.pass.cpp | 1 - .../atomics.types.float/fetch_sub.pass.cpp | 1 - .../atomics.types.float/load.pass.cpp | 1 - .../atomics.types.float/lockfree.pass.cpp | 1 - .../atomics.types.float/notify_all.pass.cpp | 1 - .../atomics.types.float/notify_one.pass.cpp | 1 - .../operator.float.pass.cpp | 1 - .../operator.minus_equals.pass.cpp | 1 - .../operator.plus_equals.pass.cpp | 1 - .../atomics.types.float/store.pass.cpp | 1 - .../atomics.types.float/wait.pass.cpp | 1 - .../atomic_compare_exchange_strong.pass.cpp | 2 +- ..._compare_exchange_strong_explicit.pass.cpp | 2 +- .../atomic_compare_exchange_weak.pass.cpp | 2 +- ...ic_compare_exchange_weak_explicit.pass.cpp | 2 +- .../atomic_exchange.pass.cpp | 2 +- .../atomic_exchange_explicit.pass.cpp | 2 +- .../atomic_init.pass.cpp | 2 +- .../atomic_is_lock_free.pass.cpp | 2 +- .../atomic_load.pass.cpp | 2 +- .../atomic_load_explicit.pass.cpp | 2 +- .../atomic_store.pass.cpp | 2 +- .../atomic_store_explicit.pass.cpp | 2 +- .../atomic_notify_all.pass.cpp | 2 +- .../atomic_notify_one.pass.cpp | 2 +- .../atomic_wait.pass.cpp | 2 +- .../atomic_wait_explicit.pass.cpp | 2 +- libcxx/test/support/atomic_helpers.h | 5 +--- libcxx/utils/libcxx/test/features.py | 27 +++++-------------- 36 files changed, 25 insertions(+), 58 deletions(-) diff --git a/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp b/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp index f9e01bd5d032b..e5cafde467603 100644 --- a/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp +++ b/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: c++03 -// REQUIRES: is-lockfree-runtime-function +// REQUIRES: has-128-bit-atomics // ADDITIONAL_COMPILE_FLAGS: -Wno-psabi // ... since C++20 std::__atomic_base initializes, so we get a warning about an // ABI change for vector variants since the constructor code for that is 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 a59839ff806ea..352e705151513 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 @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // 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 1561bd27d8d7e..51085a0b1037e 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 @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // 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 84ef7b70bc0aa..0b09a7331fd1e 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 @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // 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 54ca29a0d427a..f8a2f196c55a8 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 @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // 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 92351d74f35c8..d1828b1a9b743 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 @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // 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 c365923c42d0a..55aa6f5a701cc 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 @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // 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 d74502f52e1b3..7350c1ddf0e90 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 @@ -8,7 +8,6 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: LIBCXX-AIX-FIXME // XFAIL: !has-64-bit-atomics -// UNSUPPORTED: !non-lockfree-atomics // https://github.com/llvm/llvm-project/issues/72893 // XFAIL: target={{x86_64-.*}} && tsan 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 2b07f1fdbb5b5..84dcde5f2784f 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 @@ -8,7 +8,6 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: LIBCXX-AIX-FIXME // XFAIL: !has-64-bit-atomics -// UNSUPPORTED: !non-lockfree-atomics // https://github.com/llvm/llvm-project/issues/72893 // XFAIL: target={{x86_64-.*}} && tsan 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 784fdb96c464d..9917c890a95d5 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 @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // XFAIL: !has-64-bit-atomics -// 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 cf5af00cd4e8b..95835c0030d34 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 @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // 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 d8bec9160c68f..1e0be68da2633 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 @@ -9,7 +9,6 @@ // XFAIL: availability-synchronization_library-missing // UNSUPPORTED: c++03, c++11, c++14, c++17 // 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 fd4ea44ff851d..7b5e668af0262 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 @@ -9,7 +9,6 @@ // XFAIL: availability-synchronization_library-missing // UNSUPPORTED: c++03, c++11, c++14, c++17 // 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 a1733276c0ec1..415709a6807e1 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 @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // 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 22233b5a62ba9..386a393e35503 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 @@ -8,7 +8,6 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: LIBCXX-AIX-FIXME // 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/operator.plus_equals.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp index 548c5ac11a265..afd06d537c7ad 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 @@ -8,7 +8,6 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: LIBCXX-AIX-FIXME // 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/store.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/store.pass.cpp index d232eea6ef014..ad354f6630a3a 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,7 +7,6 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // XFAIL: !has-64-bit-atomics -// 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 ad70c133b99eb..df487cec88089 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,7 +8,6 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17 // XFAIL: availability-synchronization_library-missing // 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.req/atomic_compare_exchange_strong.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp index e5cf6aa12dc14..51a4671b5e5d6 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp index f039069b49e94..91b066c320287 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp index 93b7ea525f843..391333bfc0375 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp index 41967bd3f5646..73f8f91f295fd 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp index 14d159a498ae7..cb873e7e15ad2 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp index 976327975f9d6..d5e1ea55632c7 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp index 4dbf8fb928b8a..e833c056ec97b 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp index 2cc7a8a0760d0..1a3b8393d8f9f 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !is-lockfree-runtime-function +// XFAIL: !has-128-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp index c8d103c180bff..4149528a90435 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp index cb9dc1a2ec7ac..64e50b75be4d5 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp index 5915220fd1891..0f97107960175 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp index e9e15a6aeaf53..009e83c4f9b23 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // 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 2c8ce34530302..26f4b4c48ba47 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 @@ -8,7 +8,7 @@ // // UNSUPPORTED: no-threads // XFAIL: c++03 -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // XFAIL: availability-synchronization_library-missing diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp index fbf89529ac332..ea192ec0594be 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp @@ -8,7 +8,7 @@ // // UNSUPPORTED: no-threads // XFAIL: c++03 -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // XFAIL: availability-synchronization_library-missing diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp index f0657a54fc659..293d059bde50f 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp @@ -8,7 +8,7 @@ // // UNSUPPORTED: no-threads // XFAIL: c++03 -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // XFAIL: availability-synchronization_library-missing diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp index 0aba0a5d28dba..d651a5dc5cfc7 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp @@ -8,7 +8,7 @@ // // UNSUPPORTED: no-threads // XFAIL: c++03 -// XFAIL: !non-lockfree-atomics +// XFAIL: !has-64-bit-atomics // XFAIL: availability-synchronization_library-missing diff --git a/libcxx/test/support/atomic_helpers.h b/libcxx/test/support/atomic_helpers.h index 8add02d946b3f..9a32b1ffe85e4 100644 --- a/libcxx/test/support/atomic_helpers.h +++ b/libcxx/test/support/atomic_helpers.h @@ -119,10 +119,7 @@ struct TestEachAtomicType { TestFunctor()(); /* 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 + so some libatomic.a is necessary. */ TestFunctor()(); /* diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py index 461e134f165fc..f0f2ecb2f4f64 100644 --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -183,25 +183,26 @@ def _getAndroidDeviceApi(cfg): actions=[AddLinkFlag("-latomic")], ), Feature( - name="non-lockfree-atomics", + name="has-64-bit-atomics", when=lambda cfg: sourceBuilds( cfg, """ #include - struct Large { int storage[100]; }; + struct Large { char storage[64/8]; }; std::atomic x; - int main(int, char**) { (void)x.load(); return 0; } + int main(int, char**) { (void)x.load(); x.is_lockfree(); return 0; } """, ), ), Feature( - name="has-64-bit-atomics", + name="has-128-bit-atomics", when=lambda cfg: sourceBuilds( cfg, """ #include - std::atomic_uint64_t x; - int main(int, char**) { (void)x.load(); return 0; } + struct Large { char storage[128/8]; }; + std::atomic x; + int main(int, char**) { (void)x.load(); x.is_lockfree(); return 0; } """, ), ), @@ -217,20 +218,6 @@ def _getAndroidDeviceApi(cfg): """, ), ), - # TODO: Remove this feature once compiler-rt includes __atomic_is_lockfree() - # on all supported platforms. - Feature( - name="is-lockfree-runtime-function", - when=lambda cfg: sourceBuilds( - cfg, - """ - #include - struct Large { int storage[100]; }; - std::atomic x; - int main(int, char**) { return x.is_lock_free(); } - """, - ), - ), # Check for a Windows UCRT bug (fixed in UCRT/Windows 10.0.20348.0): # https://developercommunity.visualstudio.com/t/utf-8-locales-break-ctype-functions-for-wchar-type/1653678 Feature( From e453788c912b85d77255fab265939249e323e6d2 Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Fri, 26 Jan 2024 20:25:22 -0800 Subject: [PATCH 2/3] Fix the feature test code --- libcxx/utils/libcxx/test/features.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py index f0f2ecb2f4f64..0f7763d55d988 100644 --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -190,7 +190,7 @@ def _getAndroidDeviceApi(cfg): #include struct Large { char storage[64/8]; }; std::atomic x; - int main(int, char**) { (void)x.load(); x.is_lockfree(); return 0; } + int main(int, char**) { (void)x.load(); (void)x.is_lock_free(); return 0; } """, ), ), @@ -202,7 +202,7 @@ def _getAndroidDeviceApi(cfg): #include struct Large { char storage[128/8]; }; std::atomic x; - int main(int, char**) { (void)x.load(); x.is_lockfree(); return 0; } + int main(int, char**) { (void)x.load(); (void)x.is_lock_free(); return 0; } """, ), ), From b3e48785e7bdcda388bf505e6bd4011034d3b084 Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Mon, 29 Jan 2024 15:28:32 -0800 Subject: [PATCH 3/3] Try fix Windows CI --- .../atomic_compare_exchange_strong.pass.cpp | 2 +- .../atomic_compare_exchange_strong_explicit.pass.cpp | 2 +- .../atomic_compare_exchange_weak.pass.cpp | 2 +- .../atomic_compare_exchange_weak_explicit.pass.cpp | 2 +- .../atomics.types.operations.req/atomic_exchange.pass.cpp | 2 +- .../atomic_exchange_explicit.pass.cpp | 2 +- .../atomics.types.operations.req/atomic_init.pass.cpp | 2 +- .../atomics.types.operations.req/atomic_load.pass.cpp | 2 +- .../atomics.types.operations.req/atomic_load_explicit.pass.cpp | 2 +- .../atomics.types.operations.req/atomic_store.pass.cpp | 2 +- .../atomics.types.operations.req/atomic_store_explicit.pass.cpp | 2 +- .../atomics.types.operations.wait/atomic_notify_all.pass.cpp | 2 +- .../atomics.types.operations.wait/atomic_notify_one.pass.cpp | 2 +- .../atomics.types.operations.wait/atomic_wait.pass.cpp | 2 +- .../atomics.types.operations.wait/atomic_wait_explicit.pass.cpp | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp index 51a4671b5e5d6..1f0f61ed3e6ea 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp index 91b066c320287..0b6fcacb3d66d 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp index 391333bfc0375..5de2f519ea435 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp index 73f8f91f295fd..fc0ad8a10acd1 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp index cb873e7e15ad2..31cd316e023a3 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp index d5e1ea55632c7..834a811c64342 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp index e833c056ec97b..4eced1d2b7f37 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp index 4149528a90435..5bb2bb2b614f9 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp index 64e50b75be4d5..ecb27a261eb65 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp index 0f97107960175..25a845e9e1f8f 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp index 009e83c4f9b23..d22657237327f 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // 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 26f4b4c48ba47..93ed607d413b2 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 @@ -8,7 +8,7 @@ // // UNSUPPORTED: no-threads // XFAIL: c++03 -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // XFAIL: availability-synchronization_library-missing diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp index ea192ec0594be..ad48ef1441f47 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp @@ -8,7 +8,7 @@ // // UNSUPPORTED: no-threads // XFAIL: c++03 -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // XFAIL: availability-synchronization_library-missing diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp index 293d059bde50f..449e50fa12b5f 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp @@ -8,7 +8,7 @@ // // UNSUPPORTED: no-threads // XFAIL: c++03 -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // XFAIL: availability-synchronization_library-missing diff --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp index d651a5dc5cfc7..a6ee4fc632797 100644 --- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp @@ -8,7 +8,7 @@ // // UNSUPPORTED: no-threads // XFAIL: c++03 -// XFAIL: !has-64-bit-atomics +// XFAIL: !has-128-bit-atomics // XFAIL: availability-synchronization_library-missing