annotate compiler-rt/test/lit.common.configured.in @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 @LIT_SITE_CFG_IN_HEADER@
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 # Set attribute value if it is unset.
anatofuz
parents:
diff changeset
4 def set_default(attr, value):
anatofuz
parents:
diff changeset
5 if not getattr(config, attr, None):
anatofuz
parents:
diff changeset
6 setattr(config, attr, value)
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 # Generic config options for all compiler-rt lit tests.
anatofuz
parents:
diff changeset
9 set_default("target_triple", "@COMPILER_RT_DEFAULT_TARGET_TRIPLE@")
anatofuz
parents:
diff changeset
10 set_default("target_cflags", "@COMPILER_RT_TEST_COMPILER_CFLAGS@")
anatofuz
parents:
diff changeset
11 set_default("host_arch", "@HOST_ARCH@")
anatofuz
parents:
diff changeset
12 set_default("target_arch", "@COMPILER_RT_DEFAULT_TARGET_ARCH@")
anatofuz
parents:
diff changeset
13 set_default("host_os", "@HOST_OS@")
anatofuz
parents:
diff changeset
14 set_default("llvm_build_mode", "@LLVM_BUILD_MODE@")
anatofuz
parents:
diff changeset
15 set_default("llvm_src_root", "@LLVM_MAIN_SRC_DIR@")
anatofuz
parents:
diff changeset
16 set_default("llvm_obj_root", "@LLVM_BINARY_DIR@")
anatofuz
parents:
diff changeset
17 set_default("compiler_rt_src_root", "@COMPILER_RT_SOURCE_DIR@")
anatofuz
parents:
diff changeset
18 set_default("compiler_rt_obj_root", "@COMPILER_RT_BINARY_DIR@")
anatofuz
parents:
diff changeset
19 set_default("enable_per_target_runtime_dir", @LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_PYBOOL@)
anatofuz
parents:
diff changeset
20 set_default("llvm_tools_dir", "@LLVM_TOOLS_DIR@")
anatofuz
parents:
diff changeset
21 set_default("llvm_shlib_dir", "@LLVM_LIBRARY_OUTPUT_INTDIR@")
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
22 set_default("gnu_ld_executable", "@GNU_LD_EXECUTABLE@")
150
anatofuz
parents:
diff changeset
23 set_default("gold_executable", "@GOLD_EXECUTABLE@")
anatofuz
parents:
diff changeset
24 set_default("clang", "@COMPILER_RT_RESOLVED_TEST_COMPILER@")
anatofuz
parents:
diff changeset
25 set_default("compiler_id", "@COMPILER_RT_TEST_COMPILER_ID@")
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
26 set_default("python_executable", "@Python3_EXECUTABLE@")
150
anatofuz
parents:
diff changeset
27 set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@)
anatofuz
parents:
diff changeset
28 set_default("compiler_rt_intercept_libdispatch", @COMPILER_RT_INTERCEPT_LIBDISPATCH_PYBOOL@)
anatofuz
parents:
diff changeset
29 set_default("compiler_rt_libdir", "@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@")
anatofuz
parents:
diff changeset
30 set_default("emulator", "@COMPILER_RT_EMULATOR@")
anatofuz
parents:
diff changeset
31 set_default("asan_shadow_scale", "@COMPILER_RT_ASAN_SHADOW_SCALE@")
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
32 set_default("memprof_shadow_scale", "@COMPILER_RT_MEMPROF_SHADOW_SCALE@")
150
anatofuz
parents:
diff changeset
33 set_default("apple_platform", "osx")
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
34 set_default("apple_platform_min_deployment_target_flag", "-mmacosx-version-min")
150
anatofuz
parents:
diff changeset
35 set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@)
anatofuz
parents:
diff changeset
36 set_default("has_lld", @COMPILER_RT_HAS_LLD_PYBOOL@)
anatofuz
parents:
diff changeset
37 set_default("can_symbolize", @CAN_SYMBOLIZE@)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
38 set_default("use_lld", @COMPILER_RT_TEST_USE_LLD_PYBOOL@)
150
anatofuz
parents:
diff changeset
39 set_default("use_thinlto", False)
anatofuz
parents:
diff changeset
40 set_default("use_lto", config.use_thinlto)
anatofuz
parents:
diff changeset
41 set_default("use_newpm", False)
anatofuz
parents:
diff changeset
42 set_default("android", @ANDROID_PYBOOL@)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
43 set_default("android_api_level", "@ANDROID_API_LEVEL@")
150
anatofuz
parents:
diff changeset
44 set_default("android_serial", "@ANDROID_SERIAL_FOR_TESTING@")
anatofuz
parents:
diff changeset
45 set_default("android_files_to_push", [])
anatofuz
parents:
diff changeset
46 set_default("have_rpc_xdr_h", @HAVE_RPC_XDR_H@)
anatofuz
parents:
diff changeset
47 set_default("gwp_asan", @COMPILER_RT_HAS_GWP_ASAN_PYBOOL@)
anatofuz
parents:
diff changeset
48 set_default("expensive_checks", @LLVM_ENABLE_EXPENSIVE_CHECKS_PYBOOL@)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
49 set_default("test_standalone_build_libs", @COMPILER_RT_TEST_STANDALONE_BUILD_LIBS_PYBOOL@)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
50 # True iff the test suite supports ignoring the test compiler's runtime library path
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
51 # and using `config.compiler_rt_libdir` instead. This only matters when the runtime
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
52 # library paths differ.
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
53 set_default("test_suite_supports_overriding_runtime_lib_path", False)
150
anatofuz
parents:
diff changeset
54 config.available_features.add('target-is-%s' % config.target_arch)
anatofuz
parents:
diff changeset
55
anatofuz
parents:
diff changeset
56 if config.enable_per_target_runtime_dir:
anatofuz
parents:
diff changeset
57 set_default("target_suffix", "")
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
58 elif config.android:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
59 if config.target_arch == "i386":
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
60 set_default("target_suffix", "-i686-android")
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
61 else:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
62 set_default("target_suffix", "-%s-android" % config.target_arch)
150
anatofuz
parents:
diff changeset
63 else:
anatofuz
parents:
diff changeset
64 set_default("target_suffix", "-%s" % config.target_arch)
anatofuz
parents:
diff changeset
65
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
66 set_default("have_zlib", "@LLVM_ENABLE_ZLIB@")
150
anatofuz
parents:
diff changeset
67 set_default("libcxx_used", "@LLVM_LIBCXX_USED@")
anatofuz
parents:
diff changeset
68
anatofuz
parents:
diff changeset
69 # LLVM tools dir can be passed in lit parameters, so try to
anatofuz
parents:
diff changeset
70 # apply substitution.
anatofuz
parents:
diff changeset
71 try:
anatofuz
parents:
diff changeset
72 config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
anatofuz
parents:
diff changeset
73 config.clang = config.clang % lit_config.params
anatofuz
parents:
diff changeset
74 config.compiler_rt_libdir = config.compiler_rt_libdir % lit_config.params
anatofuz
parents:
diff changeset
75 except KeyError as e:
anatofuz
parents:
diff changeset
76 key, = e.args
anatofuz
parents:
diff changeset
77 lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
anatofuz
parents:
diff changeset
78
anatofuz
parents:
diff changeset
79 if not os.path.exists(config.clang):
anatofuz
parents:
diff changeset
80 lit_config.fatal("Can't find compiler on path %r" % config.clang)
anatofuz
parents:
diff changeset
81
anatofuz
parents:
diff changeset
82 # Setup attributes common for all compiler-rt projects.
anatofuz
parents:
diff changeset
83 lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/test/lit.common.cfg.py")