• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1configure_lit_site_cfg(
2  ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in
3  ${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured)
4
5# BlocksRuntime and builtins testsuites are not yet ported to lit.
6# add_subdirectory(BlocksRuntime)
7# add_subdirectory(builtins)
8
9set(SANITIZER_COMMON_LIT_TEST_DEPS)
10# When ANDROID, we build tests with the host compiler (i.e. CMAKE_C_COMPILER),
11# and run tests with tools from the host toolchain.
12if(NOT ANDROID)
13  if(NOT COMPILER_RT_STANDALONE_BUILD)
14    # Use LLVM utils and Clang from the same build tree.
15    list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS
16      clang clang-headers FileCheck count not llvm-nm llvm-symbolizer
17      compiler-rt-headers)
18  endif()
19  if(UNIX)
20    list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS SanitizerLintCheck)
21  endif()
22endif()
23
24# Run sanitizer tests only if we're sure that clang would produce
25# working binaries.
26if(COMPILER_RT_CAN_EXECUTE_TESTS)
27  if(ASAN_SUPPORTED_ARCH OR ANDROID)
28    add_subdirectory(asan)
29  endif()
30  if(DFSAN_SUPPORTED_ARCH)
31    add_subdirectory(dfsan)
32  endif()
33  if(LSAN_SUPPORTED_ARCH)
34    add_subdirectory(lsan)
35  endif()
36  if(MSAN_SUPPORTED_ARCH)
37    add_subdirectory(msan)
38  endif()
39  if(PROFILE_SUPPORTED_ARCH)
40    add_subdirectory(profile)
41  endif()
42  if(SANITIZER_COMMON_SUPPORTED_ARCH)
43    add_subdirectory(sanitizer_common)
44  endif()
45  if(TSAN_SUPPORTED_ARCH)
46    add_subdirectory(tsan)
47  endif()
48  if(UBSAN_SUPPORTED_ARCH)
49    add_subdirectory(ubsan)
50  endif()
51endif()
52
53if(COMPILER_RT_STANDALONE_BUILD)
54  # Now that we've traversed all the directories and know all the lit testsuites,
55  # introduce a rule to run to run all of them.
56  get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES)
57  get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS)
58  add_lit_target(check-all
59    "Running all regression tests"
60    ${LLVM_LIT_TESTSUITES}
61    DEPENDS ${LLVM_LIT_DEPENDS})
62endif()
63