1 set(MSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
4 set(MSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} msan)
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(COMPILER_RT_LIBCXX_PATH AND COMPILER_RT_LIBCXXABI_PATH)
45 configure_lit_site_cfg(
46 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
47 ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py)
48 list(APPEND MSAN_TEST_DEPS MsanUnitTests)
49 list(APPEND MSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit)
52 add_lit_testsuite(check-msan "Running the MemorySanitizer tests"
54 DEPENDS ${MSAN_TEST_DEPS}