1 set(MSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
4 set(MSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
6 set(MSAN_TEST_ARCH ${MSAN_SUPPORTED_ARCH})
8 darwin_filter_host_archs(MSAN_SUPPORTED_ARCH MSAN_TEST_ARCH)
11 macro(add_msan_testsuite arch lld thinlto)
12 set(MSAN_TEST_TARGET_ARCH ${arch})
13 get_test_cc_for_arch(${arch} MSAN_TEST_TARGET_CC MSAN_TEST_TARGET_CFLAGS)
15 string(TOUPPER ${arch} CONFIG_NAME)
18 set(CONFIG_NAME "thinlto-${CONFIG_NAME}")
19 list(APPEND MSAN_TEST_DEPS LTO)
22 set(CONFIG_NAME "lld-${CONFIG_NAME}")
24 list(APPEND MSAN_TEST_DEPS lld)
27 set(MSAN_TEST_USE_THINLTO ${thinlto})
28 set(MSAN_TEST_USE_LLD ${lld})
30 configure_lit_site_cfg(
31 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
32 ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
33 list(APPEND MSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
36 foreach(arch ${MSAN_TEST_ARCH})
37 add_msan_testsuite(${arch} False False)
39 if(COMPILER_RT_HAS_LLD AND arch STREQUAL "x86_64" AND NOT (APPLE OR WIN32))
40 add_msan_testsuite(${arch} True False)
44 if(NOT COMPILER_RT_STANDALONE_BUILD)
45 list(APPEND MSAN_TEST_DEPS msan)
48 if(COMPILER_RT_INCLUDE_TESTS AND
49 COMPILER_RT_LIBCXX_PATH AND
50 COMPILER_RT_LIBCXXABI_PATH)
51 configure_lit_site_cfg(
52 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
53 ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py)
54 list(APPEND MSAN_TEST_DEPS MsanUnitTests)
55 list(APPEND MSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit)
58 add_lit_testsuite(check-msan "Running the MemorySanitizer tests"
60 DEPENDS ${MSAN_TEST_DEPS}
62 set_target_properties(check-msan PROPERTIES FOLDER "Compiler-RT Misc")