forked from OSchip/llvm-project
33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
# -*- Python -*-
|
|
|
|
import os
|
|
|
|
# Setup config name.
|
|
config.name = 'EfficiencySanitizer' + config.name_suffix
|
|
|
|
# Setup source root.
|
|
config.test_source_root = os.path.dirname(__file__)
|
|
|
|
# Setup default compiler flags used with -fsanitize=efficiency option.
|
|
base_cflags = ([config.target_cflags] + config.debug_info_flags)
|
|
base_cxxflags = config.cxx_mode_flags + base_cflags
|
|
|
|
frag_cflags = (["-fsanitize=efficiency-cache-frag"] + base_cflags)
|
|
|
|
def build_invocation(compile_flags):
|
|
return " " + " ".join([config.clang] + compile_flags) + " "
|
|
|
|
config.substitutions.append( ("%clang_esan_frag ",
|
|
build_invocation(frag_cflags)) )
|
|
|
|
default_esan_opts = ''
|
|
config.substitutions.append(('%env_esan_opts=',
|
|
'env ESAN_OPTIONS=' + default_esan_opts))
|
|
|
|
# Default test suffixes.
|
|
config.suffixes = ['.c', '.cpp']
|
|
|
|
# EfficiencySanitizer tests are currently supported on Linux x86-64 only.
|
|
if config.host_os not in ['Linux'] or config.target_arch != 'x86_64':
|
|
config.unsupported = True
|