1 # Cross project tests, for tests that require access to multiple projects across
2 # LLVM (e.g. clang, lld and lldb).
3 # The subset inside debuginfo-tests invoke clang to generate programs with
4 # various types of debug info, and then run those programs under a debugger
5 # such as GDB or LLDB to verify the results.
6 set(LLVM_SUBPROJECT_TITLE "Cross-Project")
8 find_package(Python3 COMPONENTS Interpreter)
10 add_llvm_executable(check-gdb-llvm-support
11 debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.cpp
13 target_link_libraries(check-gdb-llvm-support PRIVATE LLVMSupport)
15 set(CROSS_PROJECT_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
16 set(CROSS_PROJECT_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
18 set(CROSS_PROJECT_TEST_DEPS
20 check-gdb-llvm-support
29 if ("clang" IN_LIST LLVM_ENABLE_PROJECTS)
30 list(APPEND CROSS_PROJECT_TEST_DEPS clang)
33 if ("mlir" IN_LIST LLVM_ENABLE_PROJECTS)
34 add_llvm_executable(check-gdb-mlir-support
35 debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp
37 target_include_directories(check-gdb-mlir-support PRIVATE
38 ${LLVM_EXTERNAL_MLIR_SOURCE_DIR}/include
39 ${LLVM_BINARY_DIR}/tools/mlir/include)
40 target_link_libraries(check-gdb-mlir-support PRIVATE MLIRIR)
41 list(APPEND CROSS_PROJECT_TEST_DEPS check-gdb-mlir-support)
42 set(MLIR_SOURCE_DIR ${LLVM_EXTERNAL_MLIR_SOURCE_DIR})
45 if("compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS)
46 # llgdb-tests/asan.c and other asan* files.
48 list(APPEND CROSS_PROJECT_TEST_DEPS asan)
50 # llgdb-tests/safestack.c
52 list(APPEND CROSS_PROJECT_TEST_DEPS safestack)
55 # Many dexter tests depend on lldb.
56 if("lldb" IN_LIST LLVM_ENABLE_PROJECTS)
57 list(APPEND CROSS_PROJECT_TEST_DEPS lldb lldb-server)
60 if ("lld" IN_LIST LLVM_ENABLE_PROJECTS)
61 list(APPEND CROSS_PROJECT_TEST_DEPS lld)
64 configure_lit_site_cfg(
65 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
66 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
68 ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
71 add_lit_testsuite(check-cross-project "Running cross-project tests"
72 ${CMAKE_CURRENT_BINARY_DIR}
73 DEPENDS ${CROSS_PROJECT_TEST_DEPS}
76 # Add alias for debuginfo test subset.
77 add_lit_testsuite(check-debuginfo "Running debuginfo tests"
78 ${CMAKE_CURRENT_BINARY_DIR}/debuginfo-tests
79 EXCLUDE_FROM_CHECK_ALL
80 DEPENDS ${CROSS_PROJECT_TEST_DEPS}
83 # Add alias for intrinsic header test subset.
84 add_lit_testsuite(check-intrinsic-headers "Running intrinsic header tests"
85 ${CMAKE_CURRENT_BINARY_DIR}/intrinsic-header-tests
86 EXCLUDE_FROM_CHECK_ALL
87 DEPENDS ${CROSS_PROJECT_TEST_DEPS}
91 add_lit_testsuite(check-cross-amdgpu "Running AMDGPU cross-project tests"
92 ${CMAKE_CURRENT_BINARY_DIR}/amdgpu
93 EXCLUDE_FROM_CHECK_ALL
97 # Add check-cross-project-* targets.
98 add_lit_testsuites(CROSS_PROJECT ${CMAKE_CURRENT_SOURCE_DIR}
99 DEPENDS ${CROSS_PROJECT_TEST_DEPS}