Skip to content

Commit b456619

Browse files
authored
[libc++] Fix name of is_always_lock_free test which was never being run (#106077)
1 parent 6d6eea9 commit b456619

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.cpp renamed to libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp

+10-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
//
8+
99
// UNSUPPORTED: c++03, c++11, c++14
10+
// XFAIL: LIBCXX-PICOLIBC-FIXME
1011

1112
// <atomic>
1213
//
@@ -15,6 +16,10 @@
1516
//
1617
// static constexpr bool is_always_lock_free;
1718

19+
// Ignore diagnostic about vector types changing the ABI on some targets, since
20+
// that is irrelevant for this test.
21+
// ADDITIONAL_COMPILE_FLAGS: -Wno-psabi
22+
1823
#include <atomic>
1924
#include <cassert>
2025
#include <concepts>
@@ -27,7 +32,8 @@ template <typename T>
2732
void check_always_lock_free(std::atomic<T> const& a) {
2833
using InfoT = LockFreeStatusInfo<T>;
2934

30-
constexpr std::same_as<const bool> decltype(auto) is_always_lock_free = std::atomic<T>::is_always_lock_free;
35+
constexpr auto is_always_lock_free = std::atomic<T>::is_always_lock_free;
36+
ASSERT_SAME_TYPE(decltype(is_always_lock_free), bool const);
3137

3238
// If we know the status of T for sure, validate the exact result of the function.
3339
if constexpr (InfoT::status_known) {
@@ -45,7 +51,8 @@ void check_always_lock_free(std::atomic<T> const& a) {
4551

4652
// In all cases, also sanity-check it based on the implication always-lock-free => lock-free.
4753
if (is_always_lock_free) {
48-
std::same_as<bool> decltype(auto) is_lock_free = a.is_lock_free();
54+
auto is_lock_free = a.is_lock_free();
55+
ASSERT_SAME_TYPE(decltype(is_always_lock_free), bool const);
4956
assert(is_lock_free);
5057
}
5158
ASSERT_NOEXCEPT(a.is_lock_free());

0 commit comments

Comments
 (0)