1 set(UBSAN_LIT_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) 2 3 set(UBSAN_LIT_TEST_MODE "Standalone") 4 configure_lit_site_cfg( 5 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in 6 ${CMAKE_CURRENT_BINARY_DIR}/UbsanConfig/lit.site.cfg) 7 set(UBSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/UbsanConfig) 8 9 if(ASAN_SUPPORTED_ARCH) 10 set(UBSAN_LIT_TEST_MODE "AddressSanitizer") 11 configure_lit_site_cfg( 12 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in 13 ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig/lit.site.cfg) 14 list(APPEND UBSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig) 15 endif() 16 17 set(UBSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) 18 if(NOT COMPILER_RT_STANDALONE_BUILD) 19 list(APPEND UBSAN_TEST_DEPS ubsan asan) 20 endif() 21 22 add_lit_testsuite(check-ubsan "Running UndefinedBehaviorSanitizer tests" 23 ${UBSAN_TESTSUITES} 24 DEPENDS ${UBSAN_TEST_DEPS}) 25 set_target_properties(check-ubsan PROPERTIES FOLDER "UBSan unittests") 26