[libcxx-commits] [PATCH] D91911: [libc++] Add a 'is-lockfree-runtime-function' lit feature

Alexander Richardson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 22 03:58:42 PST 2020


This revision was automatically updated to reflect the committed changes.
arichardson marked 3 inline comments as done.
Closed by commit rG0f81598cc1f4: [libc++] Add a 'is-lockfree-runtime-function' lit feature (authored by arichardson).

Changed prior to commit:
  https://reviews.llvm.org/D91911?vs=307861&id=313289#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91911/new/

https://reviews.llvm.org/D91911

Files:
  libcxx/test/libcxx/atomics/atomics.align/align.pass.pass.cpp
  libcxx/utils/libcxx/test/features.py


Index: libcxx/utils/libcxx/test/features.py
===================================================================
--- libcxx/utils/libcxx/test/features.py
+++ libcxx/utils/libcxx/test/features.py
@@ -55,7 +55,16 @@
             #include <atomic>
             struct Large { int storage[100]; };
             std::atomic<Large> x;
-            int main(int, char**) { return x.load(), x.is_lock_free(); }
+            int main(int, char**) { (void)x.load(); return 0; }
+          """)),
+  # TODO: Remove this feature once compiler-rt includes __atomic_is_lockfree()
+  # on all supported platforms.
+  Feature(name='is-lockfree-runtime-function',
+          when=lambda cfg: sourceBuilds(cfg, """
+            #include <atomic>
+            struct Large { int storage[100]; };
+            std::atomic<Large> x;
+            int main(int, char**) { return x.is_lock_free(); }
           """)),
 
   Feature(name='apple-clang',                                                                                                      when=_isAppleClang),
Index: libcxx/test/libcxx/atomics/atomics.align/align.pass.pass.cpp
===================================================================
--- libcxx/test/libcxx/atomics/atomics.align/align.pass.pass.cpp
+++ libcxx/test/libcxx/atomics/atomics.align/align.pass.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 //
 // UNSUPPORTED: libcpp-has-no-threads, c++03
-// REQUIRES: non-lockfree-atomics
+// REQUIRES: is-lockfree-runtime-function
 
 // GCC currently fails because it needs -fabi-version=6 to fix mangling of
 // std::atomic when used with __attribute__((vector(X))).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91911.313289.patch
Type: text/x-patch
Size: 1677 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201222/ea285492/attachment-0001.bin>


More information about the libcxx-commits mailing list