Mercurial > hg > CbC > CbC_llvm
diff projects/compiler-rt/test/esan/lit.cfg @ 131:f476a9ba4795
http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
author | mir3636 |
---|---|
date | Fri, 16 Feb 2018 21:02:11 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/projects/compiler-rt/test/esan/lit.cfg Fri Feb 16 21:02:11 2018 +0900 @@ -0,0 +1,44 @@ +# -*- 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) +wset_cflags = (["-fsanitize=efficiency-working-set"] + base_cflags) +esan_incdir = config.test_source_root + "/../../lib" +unit_cxxflags = (["-I%s" % esan_incdir, "-std=c++11", + # We need to link with the esan runtime. + # Tests should pass %env_esan_opts="record_snapshots=0". + "-fsanitize=efficiency-working-set"] + base_cxxflags) + +def build_invocation(compile_flags): + return " " + " ".join([config.clang] + compile_flags) + " " + +config.substitutions.append( ("%clang ", + build_invocation(base_cflags)) ) +config.substitutions.append( ("%clang_esan_frag ", + build_invocation(frag_cflags)) ) +config.substitutions.append( ("%clang_esan_wset ", + build_invocation(wset_cflags)) ) +config.substitutions.append( ("%clangxx_unit", + build_invocation(unit_cxxflags)) ) + +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 not in ['x86_64', 'mips64'] : + config.unsupported = True