1 # Debug Info tests. These tests invoke clang to generate programs with
2 # various types of debug info, and then run those programs under a debugger
3 # such as GDB or LLDB to verify the results.
5 find_package(Python3 COMPONENTS Interpreter)
7 add_llvm_executable(check-gdb-llvm-support
8 llvm-prettyprinters/gdb/llvm-support.cpp
10 target_link_libraries(check-gdb-llvm-support PRIVATE LLVMSupport)
12 set(DEBUGINFO_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
13 set(DEBUGINFO_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
15 set(DEBUGINFO_TEST_DEPS
21 check-gdb-llvm-support
25 if ("mlir" IN_LIST LLVM_ENABLE_PROJECTS)
26 add_llvm_executable(check-gdb-mlir-support
27 llvm-prettyprinters/gdb/mlir-support.cpp
29 target_include_directories(check-gdb-mlir-support PRIVATE
30 ${LLVM_EXTERNAL_MLIR_SOURCE_DIR}/include
31 ${LLVM_BINARY_DIR}/tools/mlir/include)
32 target_link_libraries(check-gdb-mlir-support PRIVATE MLIRIR)
33 list(APPEND DEBUGINFO_TEST_DEPS check-gdb-mlir-support)
34 set(MLIR_SOURCE_DIR ${LLVM_EXTERNAL_MLIR_SOURCE_DIR})
37 if("compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS)
38 # llgdb-tests/asan.c and other asan* files.
40 list(APPEND DEBUGINFO_TEST_DEPS asan)
42 # llgdb-tests/safestack.c
44 list(APPEND DEBUGINFO_TEST_DEPS safestack)
47 # Many dexter tests depend on lldb.
48 if("lldb" IN_LIST LLVM_ENABLE_PROJECTS)
49 list(APPEND DEBUGINFO_TEST_DEPS lldb lldb-server)
52 # The Windows builder scripts pass -fuse-ld=lld.
54 set(DEBUGINFO_TEST_DEPS ${DEBUGINFO_TEST_DEPS} lld)
57 configure_lit_site_cfg(
58 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
59 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
61 ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
64 add_lit_testsuite(check-debuginfo "Running debug info integration tests"
65 ${CMAKE_CURRENT_BINARY_DIR}
66 DEPENDS ${DEBUGINFO_TEST_DEPS}
69 # Add check-debuginfo-* targets.
70 add_lit_testsuites(DEBUGINFO ${CMAKE_CURRENT_SOURCE_DIR}
71 DEPENDS ${DEBUGINFO_TEST_DEPS}
74 set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")