--- /dev/null
+set(LIBCXX_TEST_PARAMS "enable_modules=True" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
//===----------------------------------------------------------------------===//
// We're building as C, so this test doesn't work when building with modules.
-// UNSUPPORTED: -fmodules
+// UNSUPPORTED: modules-build
// GCC complains about unrecognized arguments because we're compiling the
// file as C, but we're passing C++ flags on the command-line.
// The test suite needs to define the ABI macros on the command line when
// modules are enabled.
-// UNSUPPORTED: -fmodules
+// UNSUPPORTED: modules-build
// <utility>
- exit_status: -1 # Agent was lost
limit: 2
+ - label: "Modular build"
+ command: "libcxx/utils/ci/run-buildbot generic-modules"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+
- label: "Static libraries"
command: "libcxx/utils/ci/run-buildbot generic-static"
artifact_paths:
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake"
check-cxx-cxxabi
;;
+generic-modules)
+ export CC=clang
+ export CXX=clang++
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake"
+ check-cxx-cxxabi
+;;
generic-static)
export CC=clang
export CXX=clang++
self.configure_link_flags()
self.configure_env()
self.configure_coverage()
- self.configure_modules()
self.configure_substitutions()
self.configure_features()
self.cxx.flags += ['-g', '--coverage']
self.cxx.compile_flags += ['-O0']
- def configure_modules(self):
- modules_flags = ['-fmodules', '-Xclang', '-fmodules-local-submodule-visibility']
- supports_modules = self.cxx.hasCompileFlag(modules_flags)
- enable_modules = self.get_lit_bool('enable_modules', default=False,
- env_var='LIBCXX_ENABLE_MODULES')
- if enable_modules and not supports_modules:
- self.lit_config.fatal(
- '-fmodules is enabled but not supported by the compiler')
- if not supports_modules:
- return
- module_cache = os.path.join(self.config.test_exec_root,
- 'modules.cache')
- module_cache = os.path.realpath(module_cache)
- if os.path.isdir(module_cache):
- shutil.rmtree(module_cache)
- os.makedirs(module_cache)
- self.cxx.modules_flags += modules_flags + \
- ['-fmodules-cache-path=' + module_cache]
- if enable_modules:
- self.config.available_features.add('-fmodules')
- self.cxx.useModules()
-
def quote(self, s):
if platform.system() == 'Windows':
return lit.TestRunner.quote_windows_command([s])
# split the part that does a death test outside of the
# test, and only disable that part when modules are
# enabled.
- if '-fmodules' in test.config.available_features and self._disableWithModules(test):
+ if 'modules-build' in test.config.available_features and self._disableWithModules(test):
return lit.Test.Result(lit.Test.UNSUPPORTED, 'Test {} is unsupported when modules are enabled')
if re.search('[.]sh[.][^.]+$', filename):
AddCompileFlag(lambda cfg: getStdFlag(cfg, std)),
]),
+ Parameter(name='enable_modules', choices=[True, False], type=bool, default=False,
+ help="Whether to build the test suite with Clang modules enabled.",
+ actions=lambda modules: [
+ AddFeature('modules-build'),
+ AddCompileFlag('-fmodules'),
+ AddCompileFlag('-Xclang -fmodules-local-submodule-visibility'),
+ ] if modules else []),
+
Parameter(name='enable_exceptions', choices=[True, False], type=bool, default=True,
help="Whether to enable exceptions when compiling the test suite.",
actions=lambda exceptions: [] if exceptions else [