1@LIT_SITE_CFG_IN_HEADER@ 2 3# Set attribute value if it is unset. 4def set_default(attr, value): 5 if not getattr(config, attr, None): 6 setattr(config, attr, value) 7 8# Generic config options for all compiler-rt lit tests. 9set_default("target_triple", "@COMPILER_RT_DEFAULT_TARGET_TRIPLE@") 10set_default("target_cflags", "@COMPILER_RT_TEST_COMPILER_CFLAGS@") 11set_default("host_arch", "@HOST_ARCH@") 12set_default("target_arch", "@COMPILER_RT_DEFAULT_TARGET_ARCH@") 13set_default("host_os", "@HOST_OS@") 14set_default("llvm_build_mode", "@LLVM_BUILD_MODE@") 15set_default("llvm_src_root", "@LLVM_MAIN_SRC_DIR@") 16set_default("llvm_obj_root", "@LLVM_BINARY_DIR@") 17set_default("compiler_rt_src_root", "@COMPILER_RT_SOURCE_DIR@") 18set_default("compiler_rt_obj_root", "@COMPILER_RT_BINARY_DIR@") 19set_default("llvm_tools_dir", "@LLVM_TOOLS_BINARY_DIR@") 20set_default("llvm_shlib_dir", "@SHLIBDIR@") 21set_default("gold_executable", "@GOLD_EXECUTABLE@") 22set_default("clang", "@COMPILER_RT_TEST_COMPILER@") 23set_default("compiler_id", "@COMPILER_RT_TEST_COMPILER_ID@") 24set_default("python_executable", "@PYTHON_EXECUTABLE@") 25set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@) 26set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@") 27set_default("emulator", "@COMPILER_RT_EMULATOR@") 28set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@) 29set_default("has_lld", @COMPILER_RT_HAS_LLD_SOURCES_PYBOOL@) 30set_default("can_symbolize", @CAN_SYMBOLIZE@) 31 32# LLVM tools dir can be passed in lit parameters, so try to 33# apply substitution. 34try: 35 config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params 36except KeyError as e: 37 key, = e.args 38 lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) 39 40# Setup attributes common for all compiler-rt projects. 41lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/test/lit.common.cfg") 42