diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -7,7 +7,7 @@ #===----------------------------------------------------------------------===## from libcxx.test.dsl import * -from libcxx.test.features import _isMSVC +from libcxx.test.features import _isGCC, _isAppleClang import re _warningFlags = [ @@ -174,14 +174,10 @@ Parameter(name='enable_experimental', choices=[True, False], type=bool, 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 - # maps to .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. + # TODO AppleClang: Use -fexperimental-library when updating to AppleClang 15 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) or _isAppleClang(cfg) else '-fexperimental-library'), + AddCompileFlag(lambda cfg: '-D_LIBCPP_ENABLE_EXPERIMENTAL' if _isGCC(cfg) or _isAppleClang(cfg) else '-fexperimental-library'), ] if experimental else [ AddFeature('libcpp-has-no-incomplete-format'), ]),