diff --git a/libcxx/test/configs/cmake-bridge.cfg.in b/libcxx/test/configs/cmake-bridge.cfg.in --- a/libcxx/test/configs/cmake-bridge.cfg.in +++ b/libcxx/test/configs/cmake-bridge.cfg.in @@ -2,6 +2,8 @@ @SERIALIZED_LIT_PARAMS@ +import shlex + # # This file performs the bridge between the CMake configuration and the Lit # configuration files by setting up the LitConfig object and various Lit @@ -23,7 +25,7 @@ config.test_exec_root = '@CMAKE_BINARY_DIR@' # Add substitutions for bootstrapping the test suite configuration -config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@')) +config.substitutions.append(('%{cxx}', shlex.quote('@CMAKE_CXX_COMPILER@'))) config.substitutions.append(('%{libcxx}', '@LIBCXX_SOURCE_DIR@')) config.substitutions.append(('%{install}', '@CMAKE_BINARY_DIR@')) config.substitutions.append(('%{include}', '%{install}/@LIBCXX_INSTALL_INCLUDE_DIR@')) diff --git a/libcxx/test/configs/llvm-libc++-mingw.cfg.in b/libcxx/test/configs/llvm-libc++-mingw.cfg.in new file mode 100644 --- /dev/null +++ b/libcxx/test/configs/llvm-libc++-mingw.cfg.in @@ -0,0 +1,32 @@ +# This testing configuration handles running the test suite against LLVM's libc++ +# using either a DLL or a static library, with MinGW/Clang on Windows. + +lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') + +config.substitutions.append(('%{flags}', '')) +config.substitutions.append(('%{compile_flags}', + '-nostdinc++ -isystem %{include} -isystem %{target-include} -I %{libcxx}/test/support' +)) +config.substitutions.append(('%{link_flags}', + '-nostdlib++ -L %{lib} -lc++' +)) +config.substitutions.append(('%{exec}', + '%{executor} --execdir %T --env PATH=%{lib} -- ' +)) + +# LIBCXX-WINDOWS-FIXME is the feature name used to XFAIL the +# initial Windows failures until they can be properly diagnosed +# and fixed. This allows easier detection of new test failures +# and regressions. Note: New failures should not be suppressed +# using this feature. (Also see llvm.org/PR32730) +config.available_features.add('LIBCXX-WINDOWS-FIXME') + +import os, site +site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) +import libcxx.test.params, libcxx.test.newconfig +libcxx.test.newconfig.configure( + libcxx.test.params.DEFAULT_PARAMETERS, + libcxx.test.features.DEFAULT_FEATURES, + config, + lit_config +) diff --git a/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in new file mode 100644 --- /dev/null +++ b/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in @@ -0,0 +1,32 @@ +# This testing configuration handles running the test suite against LLVM's libc++ +# using a DLL, with Clang-cl on Windows. + +lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') + +config.substitutions.append(('%{flags}', '--driver-mode=g++')) +config.substitutions.append(('%{compile_flags}', + '-nostdinc++ -isystem %{include} -isystem %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' +)) +config.substitutions.append(('%{link_flags}', + '-nostdlib -L %{lib} -lc++ -lmsvcrt -lmsvcprt -loldnames' +)) +config.substitutions.append(('%{exec}', + '%{executor} --execdir %T --env PATH=%{lib} -- ' +)) + +# LIBCXX-WINDOWS-FIXME is the feature name used to XFAIL the +# initial Windows failures until they can be properly diagnosed +# and fixed. This allows easier detection of new test failures +# and regressions. Note: New failures should not be suppressed +# using this feature. (Also see llvm.org/PR32730) +config.available_features.add('LIBCXX-WINDOWS-FIXME') + +import os, site +site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) +import libcxx.test.params, libcxx.test.newconfig +libcxx.test.newconfig.configure( + libcxx.test.params.DEFAULT_PARAMETERS, + libcxx.test.features.DEFAULT_FEATURES, + config, + lit_config +) diff --git a/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in new file mode 100644 --- /dev/null +++ b/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in @@ -0,0 +1,32 @@ +# This testing configuration handles running the test suite against LLVM's libc++ +# using a static library, with Clang-cl on Windows. + +lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') + +config.substitutions.append(('%{flags}', '--driver-mode=g++')) +config.substitutions.append(('%{compile_flags}', + '-nostdinc++ -isystem %{include} -isystem %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' +)) +config.substitutions.append(('%{link_flags}', + '-nostdlib -L %{lib} -llibc++ -lmsvcrt -lmsvcprt -loldnames' +)) +config.substitutions.append(('%{exec}', + '%{executor} --execdir %T --env PATH=%{lib} -- ' +)) + +# LIBCXX-WINDOWS-FIXME is the feature name used to XFAIL the +# initial Windows failures until they can be properly diagnosed +# and fixed. This allows easier detection of new test failures +# and regressions. Note: New failures should not be suppressed +# using this feature. (Also see llvm.org/PR32730) +config.available_features.add('LIBCXX-WINDOWS-FIXME') + +import os, site +site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) +import libcxx.test.params, libcxx.test.newconfig +libcxx.test.newconfig.configure( + libcxx.test.params.DEFAULT_PARAMETERS, + libcxx.test.features.DEFAULT_FEATURES, + config, + lit_config +) diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -597,13 +597,15 @@ # correctly when libc++ visibility attributes indicate dllimport linkage # anyway), thus just disable the experimental library. Remove this # setting when cmake and the test driver does the right thing automatically. - generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF + generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \ + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-clangcl.cfg.in" echo "+++ Running the libc++ tests" ${NINJA} -vC "${BUILD_DIR}" check-cxx ;; clang-cl-static) clean - generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF + generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF \ + -DLIBCXX_TEST_CONFIG="llvm-libc++-static-clangcl.cfg.in" echo "+++ Running the libc++ tests" ${NINJA} -vC "${BUILD_DIR}" check-cxx ;; @@ -617,6 +619,7 @@ generate-cmake \ -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \ -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \ + -DLIBCXX_TEST_CONFIG="llvm-libc++-mingw.cfg.in" \ -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" echo "+++ Running the libc++ tests" ${NINJA} -vC "${BUILD_DIR}" check-cxx @@ -626,6 +629,7 @@ generate-cmake \ -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \ -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \ + -DLIBCXX_TEST_CONFIG="llvm-libc++-mingw.cfg.in" \ -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" \ -DLIBCXX_ENABLE_SHARED=OFF \ -DLIBUNWIND_ENABLE_SHARED=OFF