2012-08-07 16:59:15 +08:00
|
|
|
set(ASAN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
|
|
|
set(ASAN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
|
|
|
|
|
2012-07-31 23:43:11 +08:00
|
|
|
configure_lit_site_cfg(
|
2013-06-07 17:38:55 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/64bitConfig/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/64bitConfig/lit.site.cfg
|
|
|
|
)
|
|
|
|
|
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/32bitConfig/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/32bitConfig/lit.site.cfg
|
2012-07-31 23:43:11 +08:00
|
|
|
)
|
|
|
|
|
2012-08-07 16:59:15 +08:00
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
|
|
|
|
)
|
|
|
|
|
2012-12-27 21:19:23 +08:00
|
|
|
if(COMPILER_RT_CAN_EXECUTE_TESTS)
|
2013-06-07 17:38:55 +08:00
|
|
|
set(ASAN_TESTSUITES)
|
|
|
|
if(CAN_TARGET_i386)
|
|
|
|
list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/32bitConfig)
|
|
|
|
endif()
|
|
|
|
if(CAN_TARGET_x86_64 OR CAN_TARGET_powerpc64)
|
|
|
|
list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/64bitConfig)
|
|
|
|
endif()
|
2012-12-27 21:19:23 +08:00
|
|
|
# Run ASan tests only if we're sure we may produce working binaries.
|
2012-08-07 19:09:41 +08:00
|
|
|
set(ASAN_TEST_DEPS
|
2013-04-11 23:49:52 +08:00
|
|
|
${SANITIZER_COMMON_LIT_TEST_DEPS}
|
2013-05-21 21:48:27 +08:00
|
|
|
${ASAN_RUNTIME_LIBRARIES}
|
|
|
|
asan_blacklist)
|
2012-09-05 18:41:25 +08:00
|
|
|
set(ASAN_TEST_PARAMS
|
2013-06-07 17:38:55 +08:00
|
|
|
asan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
|
2012-08-07 19:09:41 +08:00
|
|
|
if(LLVM_INCLUDE_TESTS)
|
|
|
|
list(APPEND ASAN_TEST_DEPS AsanUnitTests)
|
2013-06-07 17:38:55 +08:00
|
|
|
list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit)
|
2012-08-07 19:09:41 +08:00
|
|
|
endif()
|
2012-08-07 16:59:15 +08:00
|
|
|
add_lit_testsuite(check-asan "Running the AddressSanitizer tests"
|
2013-06-07 17:38:55 +08:00
|
|
|
${ASAN_TESTSUITES}
|
2012-09-05 18:41:25 +08:00
|
|
|
PARAMS ${ASAN_TEST_PARAMS}
|
2013-06-07 17:38:55 +08:00
|
|
|
DEPENDS ${ASAN_TEST_DEPS})
|
2012-08-07 16:59:15 +08:00
|
|
|
set_target_properties(check-asan PROPERTIES FOLDER "ASan tests")
|
|
|
|
endif()
|