Skip to content

release/19.x: [libc++] Fix name of is_always_lock_free test which was never being run (#106077) #110838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Oct 2, 2024

Backport b456619

Requested by: @ldionne

@llvmbot llvmbot requested a review from a team as a code owner October 2, 2024 13:00
@llvmbot llvmbot added this to the LLVM 19.X Release milestone Oct 2, 2024
@llvmbot
Copy link
Member Author

llvmbot commented Oct 2, 2024

@ldionne What do you think about merging this PR to the release branch?

@llvmbot llvmbot requested a review from ldionne October 2, 2024 13:00
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Oct 2, 2024
@llvmbot
Copy link
Member Author

llvmbot commented Oct 2, 2024

@llvm/pr-subscribers-libcxx

Author: None (llvmbot)

Changes

Backport b456619

Requested by: @ldionne


Full diff: https://github.com/llvm/llvm-project/pull/110838.diff

1 Files Affected:

  • (renamed) libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp (+10-3)
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 2dc7f5c7654193..723e7b36f50319 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
 
 // <atomic>
 //
@@ -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 <atomic>
 #include <cassert>
 #include <cstddef>
@@ -26,7 +31,8 @@ template <typename T>
 void check_always_lock_free(std::atomic<T> const& a) {
   using InfoT = LockFreeStatusInfo<T>;
 
-  constexpr std::same_as<const bool> decltype(auto) is_always_lock_free = std::atomic<T>::is_always_lock_free;
+  constexpr auto is_always_lock_free = std::atomic<T>::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<T> 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<bool> 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());

@ldionne
Copy link
Member

ldionne commented Oct 2, 2024

Impact: basically none, this adds test coverage we should always have had.

@tru tru merged commit b0b36c0 into llvm:release/19.x Oct 11, 2024
8 of 11 checks passed
Copy link

@ldionne (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants