[libcxx-commits] [libcxx] [libc++] Use -fexperimental-library in the test suite when available (PR #110892)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 2 10:10:09 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

That flag was introduced a long time ago at this point, so all supported versions of Clang and Clang-cl should understand it.

Closes #<!-- -->77646

---
Full diff: https://github.com/llvm/llvm-project/pull/110892.diff


1 Files Affected:

- (modified) libcxx/utils/libcxx/test/params.py (+2-7) 


``````````diff
diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 13c7297fd7304f..0b6f4f7f41f0bb 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -348,14 +348,9 @@ def getSuitableClangTidy(cfg):
         default=True,
         help="Whether to enable tests for experimental C++ Library features.",
         actions=lambda experimental: [
-            # When linking in MSVC mode via the Clang driver, a -l<foo>
-            # maps to <foo>.lib, so we need to use -llibc++experimental here
-            # to make it link against the static libc++experimental.lib.
-            # We can't check for the feature 'msvc' in available_features
-            # as those features are added after processing parameters.
             AddFeature("c++experimental"),
-            PrependLinkFlag(lambda cfg: "-llibc++experimental" if _isMSVC(cfg) else "-lc++experimental"),
-            AddCompileFlag("-D_LIBCPP_ENABLE_EXPERIMENTAL"),
+            PrependLinkFlag(lambda cfg: "-lc++experimental" if _isGCC(cfg) else "-fexperimental-library"),
+            AddCompileFlag(lambda cfg: "-D_LIBCPP_ENABLE_EXPERIMENTAL" if _isGCC(cfg) else "-fexperimental-library"),
         ]
         if experimental
         else [

``````````

</details>


https://github.com/llvm/llvm-project/pull/110892


More information about the libcxx-commits mailing list