Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / orc / lit.cfg.py
blobbd031d79826d3a0b7e0981a079b85459a106bdae
1 # -*- Python -*-
3 import os
5 # Setup config name.
6 config.name = "ORC" + config.name_suffix
8 # Setup source root.
9 config.test_source_root = os.path.dirname(__file__)
11 # Determine whether the test target is compatible with execution on the host.
12 host_arch_compatible = config.target_arch == config.host_arch
14 if config.host_arch == "x86_64h" and config.target_arch == "x86_64":
15 host_arch_compatible = True
16 config.test_target_is_host_executable = (
17 config.target_os == config.host_os and host_arch_compatible
20 # Assume that llvm-jitlink is in the config.llvm_tools_dir.
21 llvm_jitlink = os.path.join(config.llvm_tools_dir, "llvm-jitlink")
22 orc_rt_executor_stem = os.path.join(
23 config.compiler_rt_obj_root, "lib/orc/tests/tools/orc-rt-executor"
25 lli = os.path.join(config.llvm_tools_dir, "lli")
26 if config.host_os == "Darwin":
27 orc_rt_path = "%s/liborc_rt_osx.a" % config.compiler_rt_libdir
28 else:
29 orc_rt_path = "%s/liborc_rt%s.a" % (config.compiler_rt_libdir, config.target_suffix)
31 if config.libunwind_shared:
32 config.available_features.add("libunwind-available")
33 shared_libunwind_path = os.path.join(config.libunwind_install_dir, "libunwind.so")
34 config.substitutions.append(("%shared_libunwind", shared_libunwind_path))
37 def build_invocation(compile_flags):
38 return " " + " ".join([config.clang] + compile_flags) + " "
41 config.substitutions.append(("%clang ", build_invocation([config.target_cflags])))
42 config.substitutions.append(
43 ("%clangxx ", build_invocation(config.cxx_mode_flags + [config.target_cflags]))
45 config.substitutions.append(
46 ("%clang_cl ", build_invocation(["--driver-mode=cl"] + [config.target_cflags]))
48 if config.host_os == "Windows":
49 config.substitutions.append(
51 "%llvm_jitlink",
53 llvm_jitlink
54 + " -orc-runtime="
55 + orc_rt_path
56 + " -no-process-syms=true -slab-allocate=64MB"
60 else:
61 config.substitutions.append(
62 ("%llvm_jitlink", (llvm_jitlink + " -orc-runtime=" + orc_rt_path))
64 config.substitutions.append(
65 ("%orc_rt_executor", orc_rt_executor_stem + "-" + config.host_arch)
67 config.substitutions.append(
69 "%lli_orc_jitlink",
70 (lli + " -jit-kind=orc -jit-linker=jitlink -orc-runtime=" + orc_rt_path),
74 # Default test suffixes.
75 config.suffixes = [".c", ".cpp", ".S", ".ll", ".test"]
77 # Exclude Inputs directories.
78 config.excludes = ["Inputs"]
80 if config.host_os not in ["Darwin", "FreeBSD", "Linux", "Windows"]:
81 config.unsupported = True