Home | History | Annotate | Download | only in sanitizer_common
      1 # -*- Python -*-
      2 
      3 # Setup source root.
      4 config.test_source_root = os.path.join(os.path.dirname(__file__), "TestCases")
      5 
      6 config.name = "SanitizerCommon-" + config.tool_name
      7 
      8 if config.tool_name == "asan":
      9   tool_cflags = ["-fsanitize=address"]
     10 elif config.tool_name == "tsan":
     11   tool_cflags = ["-fsanitize=thread"]
     12 elif config.tool_name == "msan":
     13   tool_cflags = ["-fsanitize=memory"]
     14 elif config.tool_name == "lsan":
     15   tool_cflags = ["-fsanitize=leak"]
     16 else:
     17   lit_config.fatal("Unknown tool for sanitizer_common tests: %r" % config.tool_name)
     18 
     19 config.available_features.add(config.tool_name)
     20 
     21 clang_cflags = ["-g"] + tool_cflags + [config.target_cflags]
     22 clang_cxxflags = config.cxx_mode_flags + clang_cflags
     23 
     24 def build_invocation(compile_flags):
     25   return " " + " ".join([config.clang] + compile_flags) + " "
     26 
     27 config.substitutions.append( ("%clang ", build_invocation(clang_cflags)) )
     28 config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) )
     29 
     30 config.suffixes = ['.c', '.cc', '.cpp']
     31 
     32 if config.host_os not in ['Linux', 'Darwin']:
     33   config.unsupported = True
     34 
     35