[SPIR-V] Fix block sorting with irreducible CFG (#116996)
[llvm-project.git] / compiler-rt / test / scudo / lit.cfg.py
blob5d45bd99804c731c50484b7efede4c1c4a34dc1c
1 # -*- Python -*-
3 import os
5 # Setup config name.
6 config.name = "Scudo" + config.name_suffix
8 # Setup source root.
9 config.test_source_root = os.path.dirname(__file__)
11 # Path to the shared library
12 shared_libscudo = os.path.join(
13 config.compiler_rt_libdir, "libclang_rt.scudo%s.so" % config.target_suffix
15 shared_minlibscudo = os.path.join(
16 config.compiler_rt_libdir, "libclang_rt.scudo_minimal%s.so" % config.target_suffix
19 # Test suffixes.
20 config.suffixes = [".c", ".cpp", ".test"]
22 # C & CXX flags.
23 c_flags = [config.target_cflags] + [
24 "-pthread",
25 "-fPIE",
26 "-pie",
27 "-O0",
28 "-UNDEBUG",
29 "-ldl",
30 "-Wl,--gc-sections",
33 # Android doesn't want -lrt.
34 if not config.android:
35 c_flags += ["-lrt"]
37 cxx_flags = c_flags + config.cxx_mode_flags + ["-std=c++11"]
39 scudo_flags = ["-fsanitize=scudo"]
42 def build_invocation(compile_flags):
43 return " " + " ".join([config.clang] + compile_flags) + " "
46 # Add substitutions.
47 config.substitutions.append(("%clang ", build_invocation(c_flags)))
48 config.substitutions.append(("%clang_scudo ", build_invocation(c_flags + scudo_flags)))
49 config.substitutions.append(
50 ("%clangxx_scudo ", build_invocation(cxx_flags + scudo_flags))
52 config.substitutions.append(("%shared_libscudo", shared_libscudo))
53 config.substitutions.append(("%shared_minlibscudo", shared_minlibscudo))
55 # Platform-specific default SCUDO_OPTIONS for lit tests.
56 default_scudo_opts = ""
57 if config.android:
58 # Android defaults to abort_on_error=1, which doesn't work for us.
59 default_scudo_opts = "abort_on_error=0"
61 # Disable GWP-ASan for scudo internal tests.
62 if config.gwp_asan:
63 config.environment["GWP_ASAN_OPTIONS"] = "Enabled=0"
65 if default_scudo_opts:
66 config.environment["SCUDO_OPTIONS"] = default_scudo_opts
67 default_scudo_opts += ":"
68 config.substitutions.append(
69 ("%env_scudo_opts=", "env SCUDO_OPTIONS=" + default_scudo_opts)
72 # Hardened Allocator tests are currently supported on Linux only.
73 if config.host_os not in ["Linux"]:
74 config.unsupported = True