Skip to content

Commit 4043627

Browse files
ldionnellvmbot
authored andcommitted
[libc++] Fix name of is_always_lock_free test which was never being run (llvm#106077)
(cherry picked from commit b456619)
1 parent d5498c3 commit 4043627

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 <cstddef>
@@ -26,7 +31,8 @@ template <typename T>
2631
void check_always_lock_free(std::atomic<T> const& a) {
2732
using InfoT = LockFreeStatusInfo<T>;
2833

29-
constexpr std::same_as<const bool> decltype(auto) is_always_lock_free = std::atomic<T>::is_always_lock_free;
34+
constexpr auto is_always_lock_free = std::atomic<T>::is_always_lock_free;
35+
ASSERT_SAME_TYPE(decltype(is_always_lock_free), bool const);
3036

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

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

0 commit comments

Comments
 (0)