Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++] Use -fexperimental-library in the test suite when available #110892

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Oct 2, 2024

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

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

Closes llvm#77646
@ldionne ldionne requested a review from a team as a code owner October 2, 2024 17:09
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Oct 2, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 2, 2024

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

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 --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 [

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[D149794] [libc++] Use -fexperimental-library when available to enable experimental features
2 participants