2017-12-13 00:54:20 +08:00
|
|
|
# Debug Info tests. These tests invoke clang to generate programs with
|
|
|
|
# various types of debug info, and then run those programs under a debugger
|
|
|
|
# such as GDB or LLDB to verify the results.
|
|
|
|
|
2020-05-14 04:31:43 +08:00
|
|
|
find_package(Python3 COMPONENTS Interpreter)
|
|
|
|
|
2020-01-31 19:19:36 +08:00
|
|
|
add_llvm_executable(check-gdb-llvm-support
|
|
|
|
llvm-prettyprinters/gdb/llvm-support.cpp
|
2020-01-11 15:47:41 +08:00
|
|
|
)
|
2020-01-31 19:19:36 +08:00
|
|
|
target_link_libraries(check-gdb-llvm-support PRIVATE LLVMSupport)
|
2020-01-11 15:47:41 +08:00
|
|
|
|
2017-12-13 00:54:20 +08:00
|
|
|
set(DEBUGINFO_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
set(DEBUGINFO_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
|
|
|
set(DEBUGINFO_TEST_DEPS
|
2018-07-19 02:17:39 +08:00
|
|
|
clang
|
2018-07-19 04:10:43 +08:00
|
|
|
FileCheck
|
2017-12-13 00:54:20 +08:00
|
|
|
count
|
2020-06-26 07:49:05 +08:00
|
|
|
llvm-config
|
2018-02-27 04:56:45 +08:00
|
|
|
llvm-objdump
|
2020-01-31 19:19:36 +08:00
|
|
|
check-gdb-llvm-support
|
2017-12-13 00:54:20 +08:00
|
|
|
not
|
|
|
|
)
|
|
|
|
|
2020-06-26 09:28:12 +08:00
|
|
|
if("compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS)
|
|
|
|
# llgdb-tests/asan.c and other asan* files.
|
|
|
|
if(TARGET asan)
|
|
|
|
list(APPEND DEBUGINFO_TEST_DEPS asan)
|
|
|
|
endif()
|
|
|
|
# llgdb-tests/safestack.c
|
|
|
|
if(TARGET safestack)
|
|
|
|
list(APPEND DEBUGINFO_TEST_DEPS safestack)
|
|
|
|
endif()
|
2020-06-26 08:56:22 +08:00
|
|
|
endif()
|
2020-06-26 09:28:12 +08:00
|
|
|
# Many dexter tests depend on lldb.
|
|
|
|
if("lldb" IN_LIST LLVM_ENABLE_PROJECTS)
|
|
|
|
list(APPEND DEBUGINFO_TEST_DEPS lldb lldb-server)
|
2020-06-26 08:56:22 +08:00
|
|
|
endif()
|
|
|
|
|
2019-11-02 02:47:53 +08:00
|
|
|
# The Windows builder scripts pass -fuse-ld=lld.
|
|
|
|
if (WIN32)
|
|
|
|
set(DEBUGINFO_TEST_DEPS ${DEBUGINFO_TEST_DEPS} lld)
|
|
|
|
endif()
|
|
|
|
|
2020-04-30 00:51:24 +08:00
|
|
|
if (NOT DEFINED Python3_EXECUTABLE)
|
2019-11-01 00:51:53 +08:00
|
|
|
message(FATAL_ERROR "Cannot run debuginfo-tests without python 3")
|
|
|
|
endif()
|
2020-04-30 00:51:24 +08:00
|
|
|
|
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
|
|
|
|
MAIN_CONFIG
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
|
|
|
|
)
|
|
|
|
|
|
|
|
add_lit_testsuite(check-debuginfo "Running debug info integration tests"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
DEPENDS ${DEBUGINFO_TEST_DEPS}
|
|
|
|
)
|
|
|
|
|
2020-06-27 02:18:18 +08:00
|
|
|
# Add check-debuginfo-* targets.
|
|
|
|
add_lit_testsuites(DEBUGINFO ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
DEPENDS ${DEBUGINFO_TEST_DEPS}
|
|
|
|
)
|
|
|
|
|
2020-04-30 00:51:24 +08:00
|
|
|
set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")
|