1 set(LSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
5 set(LSAN_TEST_ARCH ${LSAN_SUPPORTED_ARCH})
7 darwin_filter_host_archs(LSAN_SUPPORTED_ARCH LSAN_TEST_ARCH)
10 foreach(arch ${LSAN_TEST_ARCH})
11 set(LSAN_TEST_TARGET_ARCH ${arch})
12 string(TOLOWER "-${arch}" LSAN_TEST_CONFIG_SUFFIX)
13 get_test_cc_for_arch(${arch} LSAN_TEST_TARGET_CC LSAN_TEST_TARGET_CFLAGS)
14 string(TOUPPER ${arch} ARCH_UPPER_CASE)
15 set(LSAN_LIT_TEST_MODE "Standalone")
16 set(CONFIG_NAME ${ARCH_UPPER_CASE}LsanConfig)
18 configure_lit_site_cfg(
19 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
20 ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
21 list(APPEND LSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
23 set(CONFIG_NAME ${ARCH_UPPER_CASE}AsanConfig)
24 set(LSAN_LIT_TEST_MODE "AddressSanitizer")
26 configure_lit_site_cfg(
27 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
28 ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
29 list(APPEND LSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
32 set(LSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
33 if(NOT COMPILER_RT_STANDALONE_BUILD)
34 list(APPEND LSAN_TEST_DEPS lsan asan)
36 add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
38 DEPENDS ${LSAN_TEST_DEPS})
39 set_target_properties(check-lsan PROPERTIES FOLDER "Compiler-RT Misc")