2017-04-22 02:11:23 +08:00
|
|
|
set(CFI_TESTSUITES)
|
2016-06-25 08:24:22 +08:00
|
|
|
|
2017-04-22 02:11:23 +08:00
|
|
|
macro (add_cfi_test_suites lld thinlto)
|
|
|
|
set(suffix)
|
|
|
|
if (${lld})
|
|
|
|
set(suffix ${suffix}-lld)
|
|
|
|
endif()
|
|
|
|
if (${thinlto})
|
|
|
|
set(suffix ${suffix}-thinlto)
|
|
|
|
endif()
|
2017-10-06 02:28:04 +08:00
|
|
|
set(suffix ${suffix}-${CFI_TEST_TARGET_ARCH})
|
2017-04-22 02:11:23 +08:00
|
|
|
|
|
|
|
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()
|
|
|
|
|
2017-10-06 02:28:04 +08:00
|
|
|
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()
|
2017-08-25 09:50:53 +08:00
|
|
|
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()
|
2017-04-22 02:11:23 +08:00
|
|
|
endif()
|
2017-10-06 02:28:04 +08:00
|
|
|
endforeach()
|
2015-02-21 04:31:18 +08:00
|
|
|
|
2015-07-30 02:12:45 +08:00
|
|
|
set(CFI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
|
2016-09-23 04:51:48 +08:00
|
|
|
list(APPEND CFI_TEST_DEPS
|
|
|
|
ubsan
|
|
|
|
stats
|
|
|
|
)
|
|
|
|
if(COMPILER_RT_HAS_CFI)
|
|
|
|
list(APPEND CFI_TEST_DEPS cfi)
|
|
|
|
endif()
|
|
|
|
|
2015-02-21 04:31:18 +08:00
|
|
|
if(NOT COMPILER_RT_STANDALONE_BUILD)
|
|
|
|
list(APPEND CFI_TEST_DEPS
|
2015-07-30 02:12:45 +08:00
|
|
|
opt
|
2016-01-16 08:31:29 +08:00
|
|
|
sanstats
|
2015-02-21 04:31:18 +08:00
|
|
|
)
|
|
|
|
if(LLVM_ENABLE_PIC AND LLVM_BINUTILS_INCDIR)
|
|
|
|
list(APPEND CFI_TEST_DEPS
|
|
|
|
LLVMgold
|
|
|
|
)
|
|
|
|
endif()
|
2015-03-17 06:00:04 +08:00
|
|
|
if(APPLE)
|
|
|
|
list(APPEND CFI_TEST_DEPS
|
|
|
|
LTO
|
|
|
|
)
|
|
|
|
endif()
|
2017-04-22 02:11:23 +08:00
|
|
|
if(NOT APPLE AND COMPILER_RT_HAS_LLD)
|
2015-07-09 06:10:34 +08:00
|
|
|
list(APPEND CFI_TEST_DEPS
|
|
|
|
lld
|
|
|
|
)
|
|
|
|
endif()
|
2015-02-21 04:31:18 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_lit_testsuite(check-cfi "Running the cfi regression tests"
|
2017-04-22 02:11:23 +08:00
|
|
|
${CFI_TESTSUITES}
|
2015-02-21 04:31:18 +08:00
|
|
|
DEPENDS ${CFI_TEST_DEPS})
|
2015-02-26 04:14:05 +08:00
|
|
|
|
|
|
|
add_lit_target(check-cfi-and-supported "Running the cfi regression tests"
|
2017-04-22 02:11:23 +08:00
|
|
|
${CFI_TESTSUITES}
|
2015-02-26 04:14:05 +08:00
|
|
|
PARAMS check_supported=1
|
|
|
|
DEPENDS ${CFI_TEST_DEPS})
|
|
|
|
|
2016-07-12 05:51:56 +08:00
|
|
|
set_target_properties(check-cfi PROPERTIES FOLDER "Compiler-RT Misc")
|
|
|
|
set_target_properties(check-cfi-and-supported PROPERTIES FOLDER "Compiler-RT Misc")
|