From b0b36c00f50fe88d95fe16b29b0fba501c1fb533 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 2 Oct 2024 08:54:25 -0400 Subject: [PATCH] [libc++] Fix name of is_always_lock_free test which was never being run (#106077) (cherry picked from commit b45661953e6974782b0ccada6f0784db04bc693f) --- ...is_always_lock_free.cpp => is_always_lock_free.pass.cpp} | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) rename libcxx/test/std/atomics/atomics.lockfree/{is_always_lock_free.cpp => is_always_lock_free.pass.cpp} (94%) diff --git a/libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.cpp b/libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp similarity index 94% rename from libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.cpp rename to libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp index 2dc7f5c76541..723e7b36f503 100644 --- a/libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.cpp +++ b/libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp @@ -5,8 +5,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// + // UNSUPPORTED: c++03, c++11, c++14 +// XFAIL: LIBCXX-PICOLIBC-FIXME // // @@ -15,6 +16,10 @@ // // static constexpr bool is_always_lock_free; +// Ignore diagnostic about vector types changing the ABI on some targets, since +// that is irrelevant for this test. +// ADDITIONAL_COMPILE_FLAGS: -Wno-psabi + #include #include #include @@ -26,7 +31,8 @@ template void check_always_lock_free(std::atomic const& a) { using InfoT = LockFreeStatusInfo; - constexpr std::same_as decltype(auto) is_always_lock_free = std::atomic::is_always_lock_free; + constexpr auto is_always_lock_free = std::atomic::is_always_lock_free; + ASSERT_SAME_TYPE(decltype(is_always_lock_free), bool const); // If we know the status of T for sure, validate the exact result of the function. if constexpr (InfoT::status_known) { @@ -44,7 +50,8 @@ void check_always_lock_free(std::atomic const& a) { // In all cases, also sanity-check it based on the implication always-lock-free => lock-free. if (is_always_lock_free) { - std::same_as decltype(auto) is_lock_free = a.is_lock_free(); + auto is_lock_free = a.is_lock_free(); + ASSERT_SAME_TYPE(decltype(is_always_lock_free), bool const); assert(is_lock_free); } ASSERT_NOEXCEPT(a.is_lock_free()); -- 2.11.4.GIT