[libcxx-commits] [libcxx] [libc++][test] Fix `is_always_lock_free` test (PR #105966)

Stephan T. Lavavej via libcxx-commits libcxx-commits at lists.llvm.org
Sat Aug 24 19:06:47 PDT 2024


https://github.com/StephanTLavavej created https://github.com/llvm/llvm-project/pull/105966

There were a couple of problems with this test added by #99570:

* It was named `is_always_lock_free.cpp` instead of `is_always_lock_free.pass.cpp`.
  + Noticed because the MSVC STL test harness looks for `MEOW.pass.cpp` specifically.
* It was using `std::same_as` without including `<concepts>`.
  + Noticed because MSVC's STL doesn't drag this in via other headers.

>From 5c56b8920c9f0a14b99a5f69047fc2a675433cec Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Sat, 24 Aug 2024 18:56:49 -0700
Subject: [PATCH 1/2] Rename to is_always_lock_free.pass.cpp.

---
 .../{is_always_lock_free.cpp => is_always_lock_free.pass.cpp}     | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename libcxx/test/std/atomics/atomics.lockfree/{is_always_lock_free.cpp => is_always_lock_free.pass.cpp} (100%)

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 100%
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

>From b84ab2f781ee4cbb81daf09c623121454ca795b0 Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Sat, 24 Aug 2024 18:57:31 -0700
Subject: [PATCH 2/2] Include `<concepts>` for `std::same_as`.

---
 .../std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp b/libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp
index 2dc7f5c7654193..db17221e515d3a 100644
--- a/libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.lockfree/is_always_lock_free.pass.cpp
@@ -17,6 +17,7 @@
 
 #include <atomic>
 #include <cassert>
+#include <concepts>
 #include <cstddef>
 
 #include "test_macros.h"



More information about the libcxx-commits mailing list