2014-02-14 19:00:07 +08:00
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured)
|
|
|
|
|
|
|
|
# BlocksRuntime and builtins testsuites are not yet ported to lit.
|
|
|
|
# add_subdirectory(BlocksRuntime)
|
|
|
|
# add_subdirectory(builtins)
|
2014-02-14 19:42:22 +08:00
|
|
|
|
2014-02-19 18:04:29 +08:00
|
|
|
set(SANITIZER_COMMON_LIT_TEST_DEPS)
|
2015-02-20 11:41:07 +08:00
|
|
|
if(COMPILER_RT_STANDALONE_BUILD)
|
|
|
|
add_executable(FileCheck IMPORTED GLOBAL)
|
|
|
|
set_property(TARGET FileCheck PROPERTY IMPORTED_LOCATION ${LLVM_TOOLS_BINARY_DIR}/FileCheck)
|
|
|
|
list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS FileCheck)
|
|
|
|
endif()
|
|
|
|
|
2014-02-18 15:52:40 +08:00
|
|
|
# When ANDROID, we build tests with the host compiler (i.e. CMAKE_C_COMPILER),
|
|
|
|
# and run tests with tools from the host toolchain.
|
2014-02-19 18:04:29 +08:00
|
|
|
if(NOT ANDROID)
|
|
|
|
if(NOT COMPILER_RT_STANDALONE_BUILD)
|
|
|
|
# Use LLVM utils and Clang from the same build tree.
|
|
|
|
list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS
|
|
|
|
clang clang-headers FileCheck count not llvm-nm llvm-symbolizer
|
2014-11-22 07:09:51 +08:00
|
|
|
compiler-rt-headers)
|
|
|
|
if (COMPILER_RT_HAS_PROFILE)
|
|
|
|
list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS profile)
|
|
|
|
endif()
|
2014-02-19 18:04:29 +08:00
|
|
|
endif()
|
2014-02-18 15:52:40 +08:00
|
|
|
if(UNIX)
|
|
|
|
list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS SanitizerLintCheck)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2014-02-14 19:42:22 +08:00
|
|
|
# Run sanitizer tests only if we're sure that clang would produce
|
|
|
|
# working binaries.
|
|
|
|
if(COMPILER_RT_CAN_EXECUTE_TESTS)
|
2014-08-09 06:01:20 +08:00
|
|
|
if(COMPILER_RT_HAS_ASAN)
|
2014-02-14 22:06:10 +08:00
|
|
|
add_subdirectory(asan)
|
|
|
|
endif()
|
2014-08-09 06:01:20 +08:00
|
|
|
if(COMPILER_RT_HAS_DFSAN)
|
2014-02-14 20:05:41 +08:00
|
|
|
add_subdirectory(dfsan)
|
|
|
|
endif()
|
2014-08-09 06:01:20 +08:00
|
|
|
if(COMPILER_RT_HAS_LSAN)
|
2014-02-14 20:26:05 +08:00
|
|
|
add_subdirectory(lsan)
|
|
|
|
endif()
|
2014-08-09 06:01:20 +08:00
|
|
|
if(COMPILER_RT_HAS_MSAN)
|
2014-02-14 21:02:58 +08:00
|
|
|
add_subdirectory(msan)
|
|
|
|
endif()
|
2014-08-09 06:01:20 +08:00
|
|
|
if(COMPILER_RT_HAS_PROFILE)
|
2014-04-01 06:45:37 +08:00
|
|
|
add_subdirectory(profile)
|
|
|
|
endif()
|
2014-08-09 06:01:20 +08:00
|
|
|
if(COMPILER_RT_HAS_SANITIZER_COMMON)
|
2014-02-20 20:18:08 +08:00
|
|
|
add_subdirectory(sanitizer_common)
|
|
|
|
endif()
|
2014-08-09 06:01:20 +08:00
|
|
|
if(COMPILER_RT_HAS_TSAN)
|
2014-02-14 22:35:48 +08:00
|
|
|
add_subdirectory(tsan)
|
|
|
|
endif()
|
2014-08-09 06:01:20 +08:00
|
|
|
if(COMPILER_RT_HAS_UBSAN)
|
2014-02-14 19:42:22 +08:00
|
|
|
add_subdirectory(ubsan)
|
|
|
|
endif()
|
2015-02-21 04:31:18 +08:00
|
|
|
add_subdirectory(cfi)
|
2015-06-16 05:08:47 +08:00
|
|
|
if(COMPILER_RT_HAS_SAFESTACK)
|
|
|
|
add_subdirectory(safestack)
|
|
|
|
endif()
|
2014-02-14 19:42:22 +08:00
|
|
|
endif()
|
2014-02-20 20:36:26 +08:00
|
|
|
|
|
|
|
if(COMPILER_RT_STANDALONE_BUILD)
|
|
|
|
# Now that we've traversed all the directories and know all the lit testsuites,
|
|
|
|
# introduce a rule to run to run all of them.
|
|
|
|
get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES)
|
|
|
|
get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS)
|
|
|
|
add_lit_target(check-all
|
|
|
|
"Running all regression tests"
|
|
|
|
${LLVM_LIT_TESTSUITES}
|
|
|
|
DEPENDS ${LLVM_LIT_DEPENDS})
|
|
|
|
endif()
|