2016-04-16 15:03:45 +08:00
|
|
|
@LIT_SITE_CFG_IN_HEADER@
|
2013-06-06 20:35:48 +08:00
|
|
|
|
2014-02-14 17:22:10 +08:00
|
|
|
# Set attribute value if it is unset.
|
|
|
|
def set_default(attr, value):
|
|
|
|
if not getattr(config, attr, None):
|
|
|
|
setattr(config, attr, value)
|
2015-09-09 06:48:35 +08:00
|
|
|
|
2013-06-06 20:35:48 +08:00
|
|
|
# Generic config options for all compiler-rt lit tests.
|
2015-09-09 06:48:35 +08:00
|
|
|
set_default("target_triple", "@COMPILER_RT_DEFAULT_TARGET_TRIPLE@")
|
2014-05-08 03:22:16 +08:00
|
|
|
set_default("target_cflags", "@COMPILER_RT_TEST_COMPILER_CFLAGS@")
|
2014-02-14 17:22:10 +08:00
|
|
|
set_default("host_arch", "@HOST_ARCH@")
|
2015-09-09 06:48:35 +08:00
|
|
|
set_default("target_arch", "@COMPILER_RT_DEFAULT_TARGET_ARCH@")
|
2014-02-14 17:22:10 +08:00
|
|
|
set_default("host_os", "@HOST_OS@")
|
|
|
|
set_default("llvm_build_mode", "@LLVM_BUILD_MODE@")
|
2016-02-02 05:08:16 +08:00
|
|
|
set_default("llvm_src_root", "@LLVM_MAIN_SRC_DIR@")
|
2014-02-14 17:22:10 +08:00
|
|
|
set_default("llvm_obj_root", "@LLVM_BINARY_DIR@")
|
|
|
|
set_default("compiler_rt_src_root", "@COMPILER_RT_SOURCE_DIR@")
|
2014-05-14 06:30:16 +08:00
|
|
|
set_default("compiler_rt_obj_root", "@COMPILER_RT_BINARY_DIR@")
|
2016-01-28 05:36:38 +08:00
|
|
|
set_default("llvm_tools_dir", "@LLVM_TOOLS_BINARY_DIR@")
|
2016-09-23 04:51:48 +08:00
|
|
|
set_default("llvm_shlib_dir", "@LLVM_LIBRARY_OUTPUT_INTDIR@")
|
2015-02-21 04:31:18 +08:00
|
|
|
set_default("gold_executable", "@GOLD_EXECUTABLE@")
|
2014-02-19 21:45:49 +08:00
|
|
|
set_default("clang", "@COMPILER_RT_TEST_COMPILER@")
|
2014-02-19 23:13:14 +08:00
|
|
|
set_default("compiler_id", "@COMPILER_RT_TEST_COMPILER_ID@")
|
2014-02-14 17:22:10 +08:00
|
|
|
set_default("python_executable", "@PYTHON_EXECUTABLE@")
|
|
|
|
set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@)
|
2014-04-01 21:16:30 +08:00
|
|
|
set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@")
|
2014-05-01 05:32:30 +08:00
|
|
|
set_default("emulator", "@COMPILER_RT_EMULATOR@")
|
2015-06-25 08:57:42 +08:00
|
|
|
set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@)
|
2015-08-11 08:33:07 +08:00
|
|
|
set_default("has_lld", @COMPILER_RT_HAS_LLD_SOURCES_PYBOOL@)
|
2016-01-23 04:26:10 +08:00
|
|
|
set_default("can_symbolize", @CAN_SYMBOLIZE@)
|
2016-08-09 19:50:53 +08:00
|
|
|
config.available_features.add('target-is-%s' % config.target_arch)
|
2013-06-06 20:35:48 +08:00
|
|
|
|
|
|
|
# LLVM tools dir can be passed in lit parameters, so try to
|
|
|
|
# apply substitution.
|
|
|
|
try:
|
2013-08-10 06:14:01 +08:00
|
|
|
config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
|
2014-12-13 10:46:56 +08:00
|
|
|
except KeyError as e:
|
2013-06-06 20:35:48 +08:00
|
|
|
key, = e.args
|
2013-08-10 06:14:01 +08:00
|
|
|
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
|
2013-06-06 20:35:48 +08:00
|
|
|
|
|
|
|
# Setup attributes common for all compiler-rt projects.
|
2014-02-14 19:00:07 +08:00
|
|
|
lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/test/lit.common.cfg")
|