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

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


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

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

>From 7e8b54f6b83999aaf2dd5feb65d982faf1aaf306 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Wed, 2 Oct 2024 13:08:14 -0400
Subject: [PATCH] [libc++] Use -fexperimental-library in the test suite when
 available

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
---
 libcxx/utils/libcxx/test/params.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

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 [



More information about the libcxx-commits mailing list