summaryrefslogtreecommitdiff
path: root/test/cfi
diff options
context:
space:
mode:
Diffstat (limited to 'test/cfi')
-rw-r--r--test/cfi/lit.cfg9
-rw-r--r--test/cfi/lit.site.cfg.in1
2 files changed, 7 insertions, 3 deletions
diff --git a/test/cfi/lit.cfg b/test/cfi/lit.cfg
index 7dae9a0d5..cbffe6ea8 100644
--- a/test/cfi/lit.cfg
+++ b/test/cfi/lit.cfg
@@ -5,13 +5,16 @@ config.name = 'cfi' + config.name_suffix
config.suffixes = ['.c', '.cpp', '.test']
config.test_source_root = os.path.dirname(__file__)
-clang = ' '.join([config.compile_wrapper, config.clang, config.target_cflags])
-clangxx = ' '.join([config.compile_wrapper, config.clang, config.target_cflags] + config.cxx_mode_flags)
+def build_invocation(compile_flags):
+ return " " + " ".join([config.clang] + compile_flags) + " "
+
+clang = build_invocation([config.target_cflags])
+clangxx = build_invocation([config.target_cflags] + config.cxx_mode_flags)
config.substitutions.append((r"%clang ", clang + ' '))
config.substitutions.append((r"%clangxx ", clangxx + ' '))
if config.lto_supported:
- clang_cfi = ' '.join(config.lto_launch + [clang] + config.lto_flags + ['-fsanitize=cfi '])
+ clang_cfi = clang + '-fsanitize=cfi '
if config.cfi_lit_test_mode == "Devirt":
config.available_features.add('devirt')
diff --git a/test/cfi/lit.site.cfg.in b/test/cfi/lit.site.cfg.in
index 066c915ef..eb9b44137 100644
--- a/test/cfi/lit.site.cfg.in
+++ b/test/cfi/lit.site.cfg.in
@@ -5,6 +5,7 @@ config.cfi_lit_test_mode = "@CFI_LIT_TEST_MODE@"
config.target_arch = "@CFI_TEST_TARGET_ARCH@"
config.target_cflags = "@CFI_TEST_TARGET_CFLAGS@"
config.use_lld = @CFI_TEST_USE_LLD@
+config.use_lto = True # CFI *requires* LTO.
config.use_thinlto = @CFI_TEST_USE_THINLTO@
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")