Home | History | Annotate | Download | only in dfsan
      1 # -*- Python -*-
      2 
      3 import os
      4 
      5 # Setup config name.
      6 config.name = 'DataFlowSanitizer'
      7 
      8 # Setup source root.
      9 config.test_source_root = os.path.dirname(__file__)
     10 
     11 # Setup default compiler flags used with -fsanitize=dataflow option.
     12 clang_dfsan_cflags = ["-fsanitize=dataflow", "-m64"]
     13 clang_dfsan_cxxflags = config.cxx_mode_flags + clang_dfsan_cflags
     14 
     15 def build_invocation(compile_flags):
     16   return " " + " ".join([config.clang] + compile_flags) + " "
     17 
     18 config.substitutions.append( ("%clang_dfsan ", build_invocation(clang_dfsan_cflags)) )
     19 config.substitutions.append( ("%clangxx_dfsan ", build_invocation(clang_dfsan_cxxflags)) )
     20 
     21 # Default test suffixes.
     22 config.suffixes = ['.c', '.cc', '.cpp']
     23 
     24 # DataFlowSanitizer tests are currently supported on Linux only.
     25 if config.host_os not in ['Linux']:
     26   config.unsupported = True
     27