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