Author: Louis Dionne Date: 2024-05-28T18:29:47-07:00 New Revision: 633ea41b54bf7b2f10850bbd5ba3c4ab06081595
URL: https://github.com/llvm/llvm-project/commit/633ea41b54bf7b2f10850bbd5ba3c4ab06081595 DIFF: https://github.com/llvm/llvm-project/commit/633ea41b54bf7b2f10850bbd5ba3c4ab06081595.diff LOG: [runtimes] Reintroduce a way to select the compiler used for the test suite (#93542) A while back, the cxx_under_test Lit parameter was removed. This patch reintroduces a Lit parameter called "compiler" which controls the value of the %{cxx} substitution used in the test suite. To run the test suite with a different compiler, one can now pass --param compiler=<path>. Added: Modified: libcxx/test/CMakeLists.txt libcxx/test/configs/cmake-bridge.cfg.in libcxx/utils/libcxx/test/params.py libcxxabi/test/CMakeLists.txt libcxxabi/test/configs/cmake-bridge.cfg.in libunwind/test/CMakeLists.txt libunwind/test/configs/cmake-bridge.cfg.in Removed: ################################################################################ diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt index fd57aa9fe8b37..ee3502d32f7ae 100644 --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -16,6 +16,8 @@ endif() set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!") set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n") +serialize_lit_string_param(SERIALIZED_LIT_PARAMS compiler "${CMAKE_CXX_COMPILER}") + if (NOT LIBCXX_ENABLE_EXCEPTIONS) serialize_lit_param(SERIALIZED_LIT_PARAMS enable_exceptions False) endif() diff --git a/libcxx/test/configs/cmake-bridge.cfg.in b/libcxx/test/configs/cmake-bridge.cfg.in index 84b3270a8940a..78d0cb5a25748 100644 --- a/libcxx/test/configs/cmake-bridge.cfg.in +++ b/libcxx/test/configs/cmake-bridge.cfg.in @@ -23,8 +23,6 @@ config.recursiveExpansionLimit = 10 config.test_exec_root = os.path.join('@CMAKE_BINARY_DIR@', 'test') # Add substitutions for bootstrapping the test suite configuration -import shlex -config.substitutions.append(('%{cxx}', shlex.quote('@CMAKE_CXX_COMPILER@'))) config.substitutions.append(('%{libcxx-dir}', '@LIBCXX_SOURCE_DIR@')) config.substitutions.append(('%{include-dir}', '@LIBCXX_GENERATED_INCLUDE_DIR@')) config.substitutions.append(('%{target-include-dir}', '@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@')) diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py index c2d294e49f488..4c8590a2135d9 100644 --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -143,6 +143,14 @@ def getSuitableClangTidy(cfg): # fmt: off DEFAULT_PARAMETERS = [ + Parameter( + name="compiler", + type=str, + help="The path of the compiler to use for testing.", + actions=lambda cxx: [ + AddSubstitution("%{cxx}", shlex.quote(cxx)), + ], + ), Parameter( name="target_triple", type=str, diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt index 586927189cf1d..cd908a3514cb2 100644 --- a/libcxxabi/test/CMakeLists.txt +++ b/libcxxabi/test/CMakeLists.txt @@ -24,6 +24,8 @@ endif() set(AUTO_GEN_COMMENT "## Autogenerated by libcxxabi configuration.\n# Do not edit!") set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n") +serialize_lit_string_param(SERIALIZED_LIT_PARAMS compiler "${CMAKE_CXX_COMPILER}") + if (NOT LIBCXXABI_ENABLE_EXCEPTIONS) serialize_lit_param(SERIALIZED_LIT_PARAMS enable_exceptions False) endif() diff --git a/libcxxabi/test/configs/cmake-bridge.cfg.in b/libcxxabi/test/configs/cmake-bridge.cfg.in index 1d0f51d37437b..3fefc6a7fdc88 100644 --- a/libcxxabi/test/configs/cmake-bridge.cfg.in +++ b/libcxxabi/test/configs/cmake-bridge.cfg.in @@ -26,7 +26,6 @@ config.test_exec_root = os.path.join('@CMAKE_BINARY_DIR@', 'test') # TODO: This is a non-standard Lit attribute and we should have another way of accessing this. config.host_triple = '@LLVM_HOST_TRIPLE@' -config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@')) config.substitutions.append(('%{libcxx}', '@LIBCXXABI_LIBCXX_PATH@')) config.substitutions.append(('%{include}', '@LIBCXXABI_SOURCE_DIR@/include')) config.substitutions.append(('%{cxx-include}', '@LIBCXXABI_HEADER_DIR@/include/c++/v1')) diff --git a/libunwind/test/CMakeLists.txt b/libunwind/test/CMakeLists.txt index 21dfbb0a84f0a..bd2e575f2a296 100644 --- a/libunwind/test/CMakeLists.txt +++ b/libunwind/test/CMakeLists.txt @@ -15,6 +15,8 @@ pythonize_bool(LIBUNWIND_USES_ARM_EHABI) set(AUTO_GEN_COMMENT "## Autogenerated by libunwind configuration.\n# Do not edit!") set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n") +serialize_lit_string_param(SERIALIZED_LIT_PARAMS compiler "${CMAKE_CXX_COMPILER}") + if (LIBUNWIND_EXECUTOR) message(DEPRECATION "LIBUNWIND_EXECUTOR is deprecated, please add executor=... to LIBUNWIND_TEST_PARAMS") serialize_lit_string_param(SERIALIZED_LIT_PARAMS executor "${LIBUNWIND_EXECUTOR}") diff --git a/libunwind/test/configs/cmake-bridge.cfg.in b/libunwind/test/configs/cmake-bridge.cfg.in index c5f34c87abb92..7fc7a3da42462 100644 --- a/libunwind/test/configs/cmake-bridge.cfg.in +++ b/libunwind/test/configs/cmake-bridge.cfg.in @@ -29,7 +29,5 @@ if not @LIBUNWIND_ENABLE_THREADS@: config.available_features.add('libunwind-no-threads') # Add substitutions for bootstrapping the test suite configuration -import shlex -config.substitutions.append(('%{cxx}', shlex.quote('@CMAKE_CXX_COMPILER@'))) config.substitutions.append(('%{include}', '@LIBUNWIND_SOURCE_DIR@/include')) config.substitutions.append(('%{lib}', '@LIBUNWIND_LIBRARY_DIR@')) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits