File: lit.common.cfg

package info (click to toggle)
llvm-toolchain-3.9 1%3A3.9.1-8
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 441,060 kB
  • ctags: 428,777
  • sloc: cpp: 2,546,577; ansic: 538,318; asm: 119,677; objc: 103,316; python: 102,148; sh: 27,847; pascal: 5,626; ml: 5,510; perl: 5,293; lisp: 4,801; makefile: 2,177; xml: 686; cs: 362; php: 212; csh: 117
file content (54 lines) | stat: -rw-r--r-- 2,043 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# -*- Python -*-

# Setup source root.
config.test_source_root = os.path.join(os.path.dirname(__file__), "TestCases")

config.name = "SanitizerCommon-" + config.name_suffix

default_tool_options = []
if config.tool_name == "asan":
  tool_cflags = ["-fsanitize=address"]
  tool_options = "ASAN_OPTIONS"
elif config.tool_name == "tsan":
  tool_cflags = ["-fsanitize=thread"]
  tool_options = "TSAN_OPTIONS"
elif config.tool_name == "msan":
  tool_cflags = ["-fsanitize=memory"]
  tool_options = "MSAN_OPTIONS"
elif config.tool_name == "lsan":
  tool_cflags = ["-fsanitize=leak"]
  tool_options = "LSAN_OPTIONS"
else:
  lit_config.fatal("Unknown tool for sanitizer_common tests: %r" % config.tool_name)

config.available_features.add(config.tool_name)

if config.target_arch not in ['arm', 'armhf', 'aarch64']:
  config.available_features.add('stable-runtime')

if config.host_os == 'Darwin':
  # On Darwin, we default to `abort_on_error=1`, which would make tests run
  # much slower. Let's override this and run lit tests with 'abort_on_error=0'.
  default_tool_options += ['abort_on_error=0']
default_tool_options_str = ':'.join(default_tool_options)
if default_tool_options_str:
  config.environment[tool_options] = default_tool_options_str
  default_tool_options_str += ':'

clang_cflags = config.debug_info_flags + tool_cflags + [config.target_cflags]
clang_cxxflags = config.cxx_mode_flags + clang_cflags

def build_invocation(compile_flags):
  return " " + " ".join([config.clang] + compile_flags) + " "

config.substitutions.append( ("%clang ", build_invocation(clang_cflags)) )
config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) )
config.substitutions.append( ("%tool_name", config.tool_name) )
config.substitutions.append( ("%tool_options", tool_options) )
config.substitutions.append( ('%env_tool_opts=',
                              'env ' + tool_options + '=' + default_tool_options_str))

config.suffixes = ['.c', '.cc', '.cpp']

if config.host_os not in ['Linux', 'Darwin']:
  config.unsupported = True