[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
Sat Nov 21 04:33:38 PST 2020


arichardson created this revision.
arichardson added reviewers: libc++, ldionne.
Herald added subscribers: libcxx-commits, jfb.
Herald added a project: libc++.
Herald added 1 blocking reviewer(s): libc++.
arichardson requested review of this revision.

On macOS 10.14 /usr/lib/system/libcompiler_rt.dylib contains all the
__atomic_load*, etc functions but does not include the __atomic_is_lock_free
function. The lack of this function causes the non-lockfree-atomics feature
to be set to false even though large atomic operations are actually
supported, it's just the is_lock_free() function that is missing.

This is required so that the !non-lockfree-atomics feature can be used
to XFAIL tests that require runtime library suport (D88818 <https://reviews.llvm.org/D88818>).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91911

Files:
  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
@@ -45,7 +45,13 @@
                                                                   #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; }
+                                                                """)),
+  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),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91911.306836.patch
Type: text/x-patch
Size: 1519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201121/b793f29a/attachment.bin>


More information about the libcxx-commits mailing list