[docs] Fix build-docs.sh
[llvm-project.git] / compiler-rt / test / lsan / CMakeLists.txt
blobb3099956d4b4978a54fc84816712f7e23e4427ad
1 set(LSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
3 set(LSAN_TESTSUITES)
4  
5 set(LSAN_TEST_ARCH ${LSAN_SUPPORTED_ARCH})
6 if(APPLE)
7   darwin_filter_host_archs(LSAN_SUPPORTED_ARCH LSAN_TEST_ARCH)
8 endif()
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})
30 endforeach()
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)
35 endif()
36 add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
37   ${LSAN_TESTSUITES}
38   DEPENDS ${LSAN_TEST_DEPS})
39 set_target_properties(check-lsan PROPERTIES FOLDER "Compiler-RT Misc")