[clang-repl] Recommit "Land initial infrastructure for incremental parsing"
[llvm-project.git] / debuginfo-tests / CMakeLists.txt
blob0b01202a0bd0e71fd2c9b14299419f32133a7bf9
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
16   clang
17   FileCheck
18   count
19   llvm-config
20   llvm-objdump
21   check-gdb-llvm-support
22   not
23   )
25 if ("mlir" IN_LIST LLVM_ENABLE_PROJECTS)
26   add_llvm_executable(check-gdb-mlir-support
27         llvm-prettyprinters/gdb/mlir-support.cpp
28   )
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})
35 endif()
37 if("compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS)
38   # llgdb-tests/asan.c and other asan* files.
39   if(TARGET asan)
40     list(APPEND DEBUGINFO_TEST_DEPS asan)
41   endif()
42   # llgdb-tests/safestack.c
43   if(TARGET safestack)
44     list(APPEND DEBUGINFO_TEST_DEPS safestack)
45   endif()
46 endif()
47 # Many dexter tests depend on lldb.
48 if("lldb" IN_LIST LLVM_ENABLE_PROJECTS)
49   list(APPEND DEBUGINFO_TEST_DEPS lldb lldb-server)
50 endif()
52 # The Windows builder scripts pass -fuse-ld=lld.
53 if (WIN32)
54   set(DEBUGINFO_TEST_DEPS ${DEBUGINFO_TEST_DEPS} lld)
55 endif()
57 configure_lit_site_cfg(
58   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
59   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
60   MAIN_CONFIG
61   ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
62   )
64 add_lit_testsuite(check-debuginfo "Running debug info integration tests"
65   ${CMAKE_CURRENT_BINARY_DIR}
66   DEPENDS ${DEBUGINFO_TEST_DEPS}
67   )
69 # Add check-debuginfo-* targets.
70 add_lit_testsuites(DEBUGINFO ${CMAKE_CURRENT_SOURCE_DIR}
71   DEPENDS ${DEBUGINFO_TEST_DEPS}
72   )
74 set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")