[compiler-rt] r315001 - [cfi] Test on all available targets.
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 5 11:28:05 PDT 2017
Author: eugenis
Date: Thu Oct 5 11:28:04 2017
New Revision: 315001
URL: http://llvm.org/viewvc/llvm-project?rev=315001&view=rev
Log:
[cfi] Test on all available targets.
Summary:
Run CFI tests on all targets current toolchain can target.
On multiarch Linux, this will run all CFI tests with -m32 and -m64.
Reviewers: pcc
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D38572
Modified:
compiler-rt/trunk/test/cfi/CMakeLists.txt
compiler-rt/trunk/test/cfi/lit.cfg
compiler-rt/trunk/test/cfi/lit.site.cfg.in
Modified: compiler-rt/trunk/test/cfi/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/CMakeLists.txt?rev=315001&r1=315000&r2=315001&view=diff
==============================================================================
--- compiler-rt/trunk/test/cfi/CMakeLists.txt (original)
+++ compiler-rt/trunk/test/cfi/CMakeLists.txt Thu Oct 5 11:28:04 2017
@@ -8,6 +8,7 @@ macro (add_cfi_test_suites lld thinlto)
if (${thinlto})
set(suffix ${suffix}-thinlto)
endif()
+ set(suffix ${suffix}-${CFI_TEST_TARGET_ARCH})
set(CFI_TEST_USE_LLD ${lld})
set(CFI_TEST_USE_THINLTO ${thinlto})
@@ -29,14 +30,21 @@ macro (add_cfi_test_suites lld thinlto)
list(APPEND CFI_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Devirt${suffix})
endmacro()
-if (APPLE)
- # FIXME: enable ThinLTO tests after fixing http://llvm.org/pr32741
- add_cfi_test_suites(False False)
-elseif(WIN32)
- add_cfi_test_suites(True False)
- add_cfi_test_suites(True True)
-else()
- if (CFI_SUPPORTED_ARCH)
+set(CFI_TEST_ARCH ${CFI_SUPPORTED_ARCH})
+if(APPLE)
+ darwin_filter_host_archs(CFI_SUPPORTED_ARCH CFI_TEST_ARCH)
+endif()
+
+foreach(arch ${CFI_TEST_ARCH})
+ set(CFI_TEST_TARGET_ARCH ${arch})
+ get_test_cc_for_arch(${arch} CFI_TEST_TARGET_CC CFI_TEST_TARGET_CFLAGS)
+ if (APPLE)
+ # FIXME: enable ThinLTO tests after fixing http://llvm.org/pr32741
+ add_cfi_test_suites(False False)
+ elseif(WIN32)
+ add_cfi_test_suites(True False)
+ add_cfi_test_suites(True True)
+ else()
add_cfi_test_suites(False False)
add_cfi_test_suites(False True)
if (COMPILER_RT_HAS_LLD)
@@ -44,7 +52,7 @@ else()
add_cfi_test_suites(True True)
endif()
endif()
-endif()
+endforeach()
set(CFI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
list(APPEND CFI_TEST_DEPS
Modified: compiler-rt/trunk/test/cfi/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/lit.cfg?rev=315001&r1=315000&r2=315001&view=diff
==============================================================================
--- compiler-rt/trunk/test/cfi/lit.cfg (original)
+++ compiler-rt/trunk/test/cfi/lit.cfg Thu Oct 5 11:28:04 2017
@@ -5,12 +5,13 @@ config.name = 'cfi' + config.name_suffix
config.suffixes = ['.c', '.cpp', '.test']
config.test_source_root = os.path.dirname(__file__)
-clangxx = ' '.join([config.clang] + config.cxx_mode_flags)
+clang = ' '.join([config.clang, config.target_cflags])
+clangxx = ' '.join([config.clang, config.target_cflags] + config.cxx_mode_flags)
-config.substitutions.append((r"%clang ", ' '.join([config.clang]) + ' '))
+config.substitutions.append((r"%clang ", clang + ' '))
config.substitutions.append((r"%clangxx ", clangxx + ' '))
if config.lto_supported:
- clang_cfi = ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-fsanitize=cfi '])
+ clang_cfi = ' '.join(config.lto_launch + [clang] + config.lto_flags + ['-fsanitize=cfi '])
if config.cfi_lit_test_mode == "Devirt":
config.available_features.add('devirt')
Modified: compiler-rt/trunk/test/cfi/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/lit.site.cfg.in?rev=315001&r1=315000&r2=315001&view=diff
==============================================================================
--- compiler-rt/trunk/test/cfi/lit.site.cfg.in (original)
+++ compiler-rt/trunk/test/cfi/lit.site.cfg.in Thu Oct 5 11:28:04 2017
@@ -2,6 +2,8 @@
config.name_suffix = "@CFI_TEST_CONFIG_SUFFIX@"
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_thinlto = @CFI_TEST_USE_THINLTO@
More information about the llvm-commits
mailing list