xref: /aosp_15_r20/external/compiler-rt/test/dfsan/lit.cfg (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot# -*- Python -*-
2*7c3d14c8STreehugger Robot
3*7c3d14c8STreehugger Robotimport os
4*7c3d14c8STreehugger Robot
5*7c3d14c8STreehugger Robot# Setup config name.
6*7c3d14c8STreehugger Robotconfig.name = 'DataFlowSanitizer' + config.name_suffix
7*7c3d14c8STreehugger Robot
8*7c3d14c8STreehugger Robot# Setup source root.
9*7c3d14c8STreehugger Robotconfig.test_source_root = os.path.dirname(__file__)
10*7c3d14c8STreehugger Robot
11*7c3d14c8STreehugger Robot# Setup default compiler flags used with -fsanitize=dataflow option.
12*7c3d14c8STreehugger Robotclang_dfsan_cflags = ["-fsanitize=dataflow", config.target_cflags]
13*7c3d14c8STreehugger Robotclang_dfsan_cxxflags = config.cxx_mode_flags + clang_dfsan_cflags
14*7c3d14c8STreehugger Robot
15*7c3d14c8STreehugger Robotdef build_invocation(compile_flags):
16*7c3d14c8STreehugger Robot  return " " + " ".join([config.clang] + compile_flags) + " "
17*7c3d14c8STreehugger Robot
18*7c3d14c8STreehugger Robotconfig.substitutions.append( ("%clang_dfsan ", build_invocation(clang_dfsan_cflags)) )
19*7c3d14c8STreehugger Robotconfig.substitutions.append( ("%clangxx_dfsan ", build_invocation(clang_dfsan_cxxflags)) )
20*7c3d14c8STreehugger Robot
21*7c3d14c8STreehugger Robot# Default test suffixes.
22*7c3d14c8STreehugger Robotconfig.suffixes = ['.c', '.cc', '.cpp']
23*7c3d14c8STreehugger Robot
24*7c3d14c8STreehugger Robot# DataFlowSanitizer tests are currently supported on Linux only.
25*7c3d14c8STreehugger Robotif config.host_os not in ['Linux']:
26*7c3d14c8STreehugger Robot  config.unsupported = True
27