summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGreg Bedwell <greg_bedwell@sn.scee.net>2017-11-13 12:57:54 +0000
committerGreg Bedwell <greg_bedwell@sn.scee.net>2017-11-13 12:57:54 +0000
commit1ad28c758255a9594220c5210bbc6fed26e6da07 (patch)
tree5cc682119844c5e5be108507ae6b68b03416f5f9 /test
parentf4cd4c0822cf29a2d9b933c4dfe000bef46ea88c (diff)
Allow compiler-rt test targets to work with multi-config CMake generators
Multi-config CMake generators need lit to be able to resolve paths of artifacts from previous build steps at lit time, rather than expect them to be fully resolved at CMake time as they may contain the build mode. Differential Revision: https://reviews.llvm.org/D38471 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt4
-rw-r--r--test/lit.common.cfg5
-rw-r--r--test/lit.common.configured.in11
3 files changed, 10 insertions, 10 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0acf87bc8..ab16f42d3 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,7 +1,7 @@
-# Needed for lit support
+# Needed for lit support in standalone builds.
include(AddLLVM)
-configure_lit_site_cfg(
+configure_compiler_rt_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in
${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured)
diff --git a/test/lit.common.cfg b/test/lit.common.cfg
index 26fbea046..af4bf007c 100644
--- a/test/lit.common.cfg
+++ b/test/lit.common.cfg
@@ -27,11 +27,6 @@ config.test_format = lit.formats.ShTest(execute_external)
if execute_external:
config.available_features.add('shell')
-# Setup clang binary.
-compiler_path = getattr(config, 'clang', None)
-if (not compiler_path) or (not os.path.exists(compiler_path)):
- lit_config.fatal("Can't find compiler on path %r" % compiler_path)
-
compiler_id = getattr(config, 'compiler_id', None)
if compiler_id == "Clang":
if platform.system() != 'Windows':
diff --git a/test/lit.common.configured.in b/test/lit.common.configured.in
index b49e8eb9a..c39a2e4af 100644
--- a/test/lit.common.configured.in
+++ b/test/lit.common.configured.in
@@ -16,14 +16,14 @@ set_default("llvm_src_root", "@LLVM_MAIN_SRC_DIR@")
set_default("llvm_obj_root", "@LLVM_BINARY_DIR@")
set_default("compiler_rt_src_root", "@COMPILER_RT_SOURCE_DIR@")
set_default("compiler_rt_obj_root", "@COMPILER_RT_BINARY_DIR@")
-set_default("llvm_tools_dir", "@LLVM_TOOLS_BINARY_DIR@")
+set_default("llvm_tools_dir", "@LLVM_TOOLS_DIR@")
set_default("llvm_shlib_dir", "@LLVM_LIBRARY_OUTPUT_INTDIR@")
set_default("gold_executable", "@GOLD_EXECUTABLE@")
-set_default("clang", "@COMPILER_RT_TEST_COMPILER@")
+set_default("clang", "@COMPILER_RT_RESOLVED_TEST_COMPILER@")
set_default("compiler_id", "@COMPILER_RT_TEST_COMPILER_ID@")
set_default("python_executable", "@PYTHON_EXECUTABLE@")
set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@)
-set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@")
+set_default("compiler_rt_libdir", "@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@")
set_default("emulator", "@COMPILER_RT_EMULATOR@")
set_default("ios", False)
set_default("iossim", False)
@@ -39,9 +39,14 @@ config.available_features.add('target-is-%s' % config.target_arch)
# apply substitution.
try:
config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
+ config.clang = config.clang % lit_config.params
+ config.compiler_rt_libdir = config.compiler_rt_libdir % lit_config.params
except KeyError as e:
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
+if not os.path.exists(config.clang):
+ lit_config.fatal("Can't find compiler on path %r" % config.clang)
+
# Setup attributes common for all compiler-rt projects.
lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/test/lit.common.cfg")