summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2018-07-19 15:32:48 +0000
committerTeresa Johnson <tejohnson@google.com>2018-07-19 15:32:48 +0000
commit07cb3aef72fdd15c627ba7cd51024f95d16d7c97 (patch)
treec3778d38aa6a143f5d32d675b19968cc5ac7f94c
parentc1d00864fe9408b0cdffb89f4631f6f5e9c8bcc2 (diff)
[compiler-rt] Add NewPM testing to CFI tests
Summary: Executes both LTO and ThinLTO CFI tests an additional time using the new pass manager. I only bothered to add with gold and not lld as testing with one linker should be sufficient. I didn't add for APPLE or WIN32 since I don't have a way to test those. Depends on D49429. Reviewers: pcc Subscribers: dberris, mgorny, mehdi_amini, delcypher, dexonsmith, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D49432 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337465 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/cfi/CMakeLists.txt22
-rw-r--r--test/cfi/lit.site.cfg.in1
-rw-r--r--test/lit.common.cfg3
-rw-r--r--test/lit.common.configured.in1
4 files changed, 19 insertions, 8 deletions
diff --git a/test/cfi/CMakeLists.txt b/test/cfi/CMakeLists.txt
index c7fadde53..4dbbf1759 100644
--- a/test/cfi/CMakeLists.txt
+++ b/test/cfi/CMakeLists.txt
@@ -1,6 +1,6 @@
set(CFI_TESTSUITES)
-macro (add_cfi_test_suites lld thinlto)
+macro (add_cfi_test_suites lld thinlto newpm)
set(suffix)
if (${lld})
set(suffix ${suffix}-lld)
@@ -8,10 +8,14 @@ macro (add_cfi_test_suites lld thinlto)
if (${thinlto})
set(suffix ${suffix}-thinlto)
endif()
+ if (${newpm})
+ set(suffix ${suffix}-newpm)
+ endif()
set(suffix ${suffix}-${CFI_TEST_TARGET_ARCH})
set(CFI_TEST_USE_LLD ${lld})
set(CFI_TEST_USE_THINLTO ${thinlto})
+ set(CFI_TEST_USE_NEWPM ${newpm})
set(CFI_LIT_TEST_MODE Standalone)
set(CFI_TEST_CONFIG_SUFFIX -standalone${suffix})
@@ -40,16 +44,18 @@ foreach(arch ${CFI_TEST_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)
+ add_cfi_test_suites(False False False)
elseif(WIN32)
- add_cfi_test_suites(True False)
- add_cfi_test_suites(True True)
+ add_cfi_test_suites(True False False)
+ add_cfi_test_suites(True True False)
else()
- add_cfi_test_suites(False False)
- add_cfi_test_suites(False True)
+ add_cfi_test_suites(False False False)
+ add_cfi_test_suites(False True False)
+ add_cfi_test_suites(False False True)
+ add_cfi_test_suites(False True True)
if (COMPILER_RT_HAS_LLD AND NOT arch STREQUAL "i386")
- add_cfi_test_suites(True False)
- add_cfi_test_suites(True True)
+ add_cfi_test_suites(True False False)
+ add_cfi_test_suites(True True False)
endif()
endif()
endforeach()
diff --git a/test/cfi/lit.site.cfg.in b/test/cfi/lit.site.cfg.in
index eb9b44137..a735e8812 100644
--- a/test/cfi/lit.site.cfg.in
+++ b/test/cfi/lit.site.cfg.in
@@ -7,6 +7,7 @@ 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@
+config.use_newpm = @CFI_TEST_USE_NEWPM@
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")
diff --git a/test/lit.common.cfg b/test/lit.common.cfg
index 4137e1c31..e860be4bc 100644
--- a/test/lit.common.cfg
+++ b/test/lit.common.cfg
@@ -317,6 +317,9 @@ if config.lto_supported:
else:
config.lto_flags += ["-flto"]
+if config.use_newpm:
+ config.lto_flags += ["-fexperimental-new-pass-manager"]
+
# Ask llvm-config about assertion mode.
try:
llvm_config_cmd = subprocess.Popen(
diff --git a/test/lit.common.configured.in b/test/lit.common.configured.in
index 17f470d1c..63d55bfde 100644
--- a/test/lit.common.configured.in
+++ b/test/lit.common.configured.in
@@ -34,6 +34,7 @@ set_default("can_symbolize", @CAN_SYMBOLIZE@)
set_default("use_lld", False)
set_default("use_thinlto", False)
set_default("use_lto", config.use_thinlto)
+set_default("use_newpm", False)
set_default("android", @ANDROID_PYBOOL@)
config.available_features.add('target-is-%s' % config.target_arch)