diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -110,7 +110,6 @@ def make_static_lib_name(self, name): """Return the full filename for the specified library name""" if self.target_info.is_windows() and not self.target_info.is_mingw(): - assert name == 'c++' # Only allow libc++ to use this function for now. return 'lib' + name + '.lib' else: return 'lib' + name + '.a' @@ -144,6 +143,9 @@ self.lit_config ) + if 'c++experimental' in self.config.available_features: + self.configure_link_flags_cxx_experimental_library() + self.lit_config.note("All available features: {}".format(self.config.available_features)) def print_config_info(self): @@ -446,6 +448,17 @@ else: self.cxx.link_flags += ['-lc++'] + def configure_link_flags_cxx_experimental_library(self): + # c++experimental is always linked statically + if self.cxx_library_root: + libname = self.make_static_lib_name('c++experimental') + abs_path = os.path.join(self.cxx_library_root, libname) + assert os.path.exists(abs_path) and \ + "static libc++ library does not exist" + self.cxx.link_flags += [abs_path] + else: + self.cxx.link_flags += ['-lc++experimental'] + def configure_link_flags_abi_library(self): cxx_abi = self.get_lit_conf('cxx_abi', 'libcxxabi') if cxx_abi == 'libstdc++': 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 @@ -89,8 +89,7 @@ Parameter(name='enable_experimental', choices=[True, False], type=bool, default=False, help="Whether to enable tests for experimental C++ libraries (typically Library Fundamentals TSes).", actions=lambda experimental: [] if not experimental else [ - AddFeature('c++experimental'), - AddLinkFlag('-lc++experimental') + AddFeature('c++experimental') ]), Parameter(name='long_tests', choices=[True, False], type=bool, default=True,