3 macro (add_cfi_test_suites lld thinlto)
6 set(suffix ${suffix}-lld)
9 set(suffix ${suffix}-thinlto)
11 set(suffix ${suffix}-${CFI_TEST_TARGET_ARCH})
13 set(CFI_TEST_USE_LLD ${lld})
14 set(CFI_TEST_USE_THINLTO ${thinlto})
16 set(CFI_LIT_TEST_MODE Standalone)
17 set(CFI_TEST_CONFIG_SUFFIX -standalone${suffix})
18 configure_lit_site_cfg(
19 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
20 ${CMAKE_CURRENT_BINARY_DIR}/Standalone${suffix}/lit.site.cfg.py
22 list(APPEND CFI_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Standalone${suffix})
24 set(CFI_LIT_TEST_MODE Devirt)
25 set(CFI_TEST_CONFIG_SUFFIX -devirt${suffix})
26 configure_lit_site_cfg(
27 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
28 ${CMAKE_CURRENT_BINARY_DIR}/Devirt${suffix}/lit.site.cfg.py
30 list(APPEND CFI_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Devirt${suffix})
33 set(CFI_TEST_ARCH ${CFI_SUPPORTED_ARCH})
35 darwin_filter_host_archs(CFI_SUPPORTED_ARCH CFI_TEST_ARCH)
38 foreach(arch ${CFI_TEST_ARCH})
39 set(CFI_TEST_TARGET_ARCH ${arch})
40 get_test_cc_for_arch(${arch} CFI_TEST_TARGET_CC CFI_TEST_TARGET_CFLAGS)
42 # FIXME: enable ThinLTO tests after fixing http://llvm.org/pr32741
43 add_cfi_test_suites(False False False)
45 add_cfi_test_suites(True False)
46 add_cfi_test_suites(True True)
48 add_cfi_test_suites(False False)
49 add_cfi_test_suites(False True)
50 if (COMPILER_RT_HAS_LLD AND NOT arch STREQUAL "i386")
51 add_cfi_test_suites(True False)
52 add_cfi_test_suites(True True)
57 set(CFI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
58 list(APPEND CFI_TEST_DEPS
62 if(COMPILER_RT_HAS_CFI)
63 list(APPEND CFI_TEST_DEPS cfi)
66 if(NOT COMPILER_RT_STANDALONE_BUILD)
67 list(APPEND CFI_TEST_DEPS
72 if(LLVM_BINUTILS_INCDIR)
73 list(APPEND CFI_TEST_DEPS
78 list(APPEND CFI_TEST_DEPS
83 if(NOT APPLE AND COMPILER_RT_HAS_LLD AND TARGET lld)
84 list(APPEND CFI_TEST_DEPS
90 add_lit_testsuite(check-cfi "Running the cfi regression tests"
92 DEPENDS ${CFI_TEST_DEPS})
94 add_lit_target(check-cfi-and-supported "Running the cfi regression tests"
96 PARAMS check_supported=1
97 DEPENDS ${CFI_TEST_DEPS})
99 set_target_properties(check-cfi PROPERTIES FOLDER "Compiler-RT Misc")
100 set_target_properties(check-cfi-and-supported PROPERTIES FOLDER "Compiler-RT Misc")