Home | History | Annotate | Download | only in lit_tests
      1 set(ASAN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
      2 set(ASAN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
      3 
      4 configure_lit_site_cfg(
      5   ${CMAKE_CURRENT_SOURCE_DIR}/64bitConfig/lit.site.cfg.in
      6   ${CMAKE_CURRENT_BINARY_DIR}/64bitConfig/lit.site.cfg
      7   )
      8 
      9 configure_lit_site_cfg(
     10   ${CMAKE_CURRENT_SOURCE_DIR}/32bitConfig/lit.site.cfg.in
     11   ${CMAKE_CURRENT_BINARY_DIR}/32bitConfig/lit.site.cfg
     12   )
     13 
     14 configure_lit_site_cfg(
     15   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
     16   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
     17   )
     18 
     19 if(COMPILER_RT_CAN_EXECUTE_TESTS)
     20   set(ASAN_TESTSUITES)
     21   if(CAN_TARGET_i386)
     22     list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/32bitConfig)
     23   endif()
     24   if(CAN_TARGET_x86_64 OR CAN_TARGET_powerpc64)
     25     list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/64bitConfig)
     26   endif()
     27   # Run ASan tests only if we're sure we may produce working binaries.
     28   set(ASAN_TEST_DEPS
     29     ${SANITIZER_COMMON_LIT_TEST_DEPS}
     30     ${ASAN_RUNTIME_LIBRARIES}
     31     asan_blacklist)
     32   set(ASAN_TEST_PARAMS
     33     asan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
     34   if(LLVM_INCLUDE_TESTS)
     35     list(APPEND ASAN_TEST_DEPS AsanUnitTests)
     36     list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit)
     37   endif()
     38   add_lit_testsuite(check-asan "Running the AddressSanitizer tests"
     39     ${ASAN_TESTSUITES}
     40     PARAMS ${ASAN_TEST_PARAMS}
     41     DEPENDS ${ASAN_TEST_DEPS})
     42   set_target_properties(check-asan PROPERTIES FOLDER "ASan tests")
     43 endif()
     44