summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common/lit.common.cfg
blob: 86c9d33d90d7623529e41f64d46dbffa18cba966 (plain)
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
# -*- Python -*-

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

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

if config.tool_name == "asan":
  tool_cflags = ["-fsanitize=address"]
elif config.tool_name == "tsan":
  tool_cflags = ["-fsanitize=thread"]
elif config.tool_name == "msan":
  tool_cflags = ["-fsanitize=memory"]
else:
  lit_config.fatal("Unknown tool for sanitizer_common tests: %r" % config.tool_name)

clang_cflags = ["-g"] + tool_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.suffixes = ['.c', '.cc', '.cpp']

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

OpenPOWER on IntegriCloud