summaryrefslogtreecommitdiff
path: root/test/cfi/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'test/cfi/CMakeLists.txt')
-rw-r--r--test/cfi/CMakeLists.txt62
1 files changed, 47 insertions, 15 deletions
diff --git a/test/cfi/CMakeLists.txt b/test/cfi/CMakeLists.txt
index c3123a8204eb..fb45f2f400ce 100644
--- a/test/cfi/CMakeLists.txt
+++ b/test/cfi/CMakeLists.txt
@@ -1,14 +1,48 @@
-set(CFI_LIT_TEST_MODE Standalone)
-configure_lit_site_cfg(
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/Standalone/lit.site.cfg
- )
+set(CFI_TESTSUITES)
-set(CFI_LIT_TEST_MODE Devirt)
-configure_lit_site_cfg(
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/Devirt/lit.site.cfg
- )
+macro (add_cfi_test_suites lld thinlto)
+ set(suffix)
+ if (${lld})
+ set(suffix ${suffix}-lld)
+ endif()
+ if (${thinlto})
+ set(suffix ${suffix}-thinlto)
+ endif()
+
+ set(CFI_TEST_USE_LLD ${lld})
+ set(CFI_TEST_USE_THINLTO ${thinlto})
+
+ set(CFI_LIT_TEST_MODE Standalone)
+ set(CFI_TEST_CONFIG_SUFFIX -standalone${suffix})
+ configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Standalone${suffix}/lit.site.cfg
+ )
+ list(APPEND CFI_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Standalone${suffix})
+
+ set(CFI_LIT_TEST_MODE Devirt)
+ set(CFI_TEST_CONFIG_SUFFIX -devirt${suffix})
+ configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Devirt${suffix}/lit.site.cfg
+ )
+ 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)
+ # FIXME: enable ThinLTO tests after fixing http://llvm.org/pr32770
+ add_cfi_test_suites(True False)
+else()
+ add_cfi_test_suites(False False)
+ add_cfi_test_suites(False True)
+ if (COMPILER_RT_HAS_LLD)
+ add_cfi_test_suites(True False)
+ add_cfi_test_suites(True True)
+ endif()
+endif()
set(CFI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
list(APPEND CFI_TEST_DEPS
@@ -34,7 +68,7 @@ if(NOT COMPILER_RT_STANDALONE_BUILD)
LTO
)
endif()
- if(WIN32 AND COMPILER_RT_HAS_LLD)
+ if(NOT APPLE AND COMPILER_RT_HAS_LLD)
list(APPEND CFI_TEST_DEPS
lld
)
@@ -42,13 +76,11 @@ if(NOT COMPILER_RT_STANDALONE_BUILD)
endif()
add_lit_testsuite(check-cfi "Running the cfi regression tests"
- ${CMAKE_CURRENT_BINARY_DIR}/Standalone
- ${CMAKE_CURRENT_BINARY_DIR}/Devirt
+ ${CFI_TESTSUITES}
DEPENDS ${CFI_TEST_DEPS})
add_lit_target(check-cfi-and-supported "Running the cfi regression tests"
- ${CMAKE_CURRENT_BINARY_DIR}/Standalone
- ${CMAKE_CURRENT_BINARY_DIR}/Devirt
+ ${CFI_TESTSUITES}
PARAMS check_supported=1
DEPENDS ${CFI_TEST_DEPS})