1 set(MSAN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) 2 set(MSAN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/..) 3 4 configure_lit_site_cfg( 5 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in 6 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) 7 8 if(MSAN_CAN_INSTRUMENT_LIBCXX) 9 configure_lit_site_cfg( 10 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in 11 ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg) 12 endif() 13 14 if(COMPILER_RT_CAN_EXECUTE_TESTS) 15 # Run MSan tests only if we're sure we may produce working binaries. 16 set(MSAN_TEST_DEPS 17 ${SANITIZER_COMMON_LIT_TEST_DEPS} 18 ${MSAN_RUNTIME_LIBRARIES} 19 msan_blacklist) 20 set(MSAN_TEST_PARAMS 21 msan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) 22 if(LLVM_INCLUDE_TESTS AND MSAN_CAN_INSTRUMENT_LIBCXX) 23 list(APPEND MSAN_TEST_DEPS MsanUnitTests) 24 endif() 25 add_lit_testsuite(check-msan "Running the MemorySanitizer tests" 26 ${CMAKE_CURRENT_BINARY_DIR} 27 PARAMS ${MSAN_TEST_PARAMS} 28 DEPENDS ${MSAN_TEST_DEPS} 29 ) 30 set_target_properties(check-msan PROPERTIES FOLDER "MSan tests") 31 endif() 32