[Flang][HLFIR] : Use the attributes from the ultimate symbol (#71195)
[llvm-project.git] / compiler-rt / unittests / lit.common.unit.cfg.py
blob557a42893ec1537764f5b879872f2ee03df91051
1 # -*- Python -*-
3 # Configuration file for 'lit' test runner.
4 # This file contains common config setup rules for unit tests in various
5 # compiler-rt testsuites.
7 import os
9 import lit.formats
11 # Copied from libcxx's config.py
12 def get_lit_conf(name, default=None):
13 # Allow overriding on the command line using --param=<name>=<val>
14 val = lit_config.params.get(name, None)
15 if val is None:
16 val = getattr(config, name, None)
17 if val is None:
18 val = default
19 return val
22 emulator = get_lit_conf("emulator", None)
24 # Setup test format
25 llvm_build_mode = getattr(config, "llvm_build_mode", "Debug")
26 config.test_format = lit.formats.GoogleTest(llvm_build_mode, "Test", emulator)
28 # Setup test suffixes.
29 config.suffixes = []
31 # Tweak PATH to include llvm tools dir.
32 llvm_tools_dir = config.llvm_tools_dir
33 if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)):
34 lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir)
35 path = os.path.pathsep.join((llvm_tools_dir, config.environment["PATH"]))
36 config.environment["PATH"] = path
38 # Propagate the temp directory. Windows requires this because it uses \Windows\
39 # if none of these are present.
40 if "TMP" in os.environ:
41 config.environment["TMP"] = os.environ["TMP"]
42 if "TEMP" in os.environ:
43 config.environment["TEMP"] = os.environ["TEMP"]
45 if config.host_os == "Darwin":
46 # Only run up to 3 processes that require shadow memory simultaneously on
47 # 64-bit Darwin. Using more scales badly and hogs the system due to
48 # inefficient handling of large mmap'd regions (terabytes) by the kernel.
49 lit_config.parallelism_groups["shadow-memory"] = 3
51 # Disable libmalloc nano allocator due to crashes running on macOS 12.0.
52 # rdar://80086125
53 config.environment["MallocNanoZone"] = "0"
55 # We crash when we set DYLD_INSERT_LIBRARIES for unit tests, so interceptors
56 # don't work.
57 config.environment["ASAN_OPTIONS"] = "verify_interceptors=0"
58 config.environment["TSAN_OPTIONS"] = "verify_interceptors=0"