Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / CMakeLists.txt
blob89862fd59eb8ec219914528bfeb2e6cb1d9f0c71
1 llvm_canonicalize_cmake_booleans(
2   BOLT_ENABLE_RUNTIME
3   )
5 configure_lit_site_cfg(
6   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
7   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
8   MAIN_CONFIG
9   ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
10   )
11 configure_lit_site_cfg(
12   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
13   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
14   MAIN_CONFIG
15   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
16   )
18 set(BOLT_TEST_PARAMS
19   bolt_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
20   )
22 if (BOLT_CLANG_EXE AND NOT "clang" IN_LIST LLVM_ENABLE_PROJECTS)
23   add_executable(clang IMPORTED GLOBAL)
24   set_property(TARGET clang PROPERTY IMPORTED_LOCATION "${BOLT_CLANG_EXE}")
25 endif()
27 if (BOLT_LLD_EXE AND NOT "lld" IN_LIST LLVM_ENABLE_PROJECTS)
28   add_executable(lld IMPORTED GLOBAL)
29   set_property(TARGET lld PROPERTY IMPORTED_LOCATION "${BOLT_LLD_EXE}")
30 endif()
32 list(APPEND BOLT_TEST_DEPS
33   clang
34   count
35   FileCheck
36   llc
37   lld
38   llvm-config
39   llvm-bolt
40   llvm-bolt-heatmap
41   llvm-bat-dump
42   llvm-dwarfdump
43   llvm-dwp
44   llvm-mc
45   llvm-nm
46   llvm-objdump
47   llvm-readelf
48   llvm-readobj
49   llvm-strings
50   llvm-strip
51   llvm-objcopy
52   merge-fdata
53   not
54   split-file
55   yaml2obj
56   )
58 add_custom_target(bolt-test-depends DEPENDS ${BOLT_TEST_DEPS})
59 set_target_properties(bolt-test-depends PROPERTIES FOLDER "BOLT")
61 add_lit_testsuite(check-bolt "Running the BOLT regression tests"
62   ${CMAKE_CURRENT_BINARY_DIR}
63   PARAMS ${BOLT_TEST_PARAMS}
64   DEPENDS ${BOLT_TEST_DEPS}
65   ARGS ${BOLT_TEST_EXTRA_ARGS}
66   )
67 set_target_properties(check-bolt PROPERTIES FOLDER "BOLT")
69 add_lit_testsuites(BOLT ${CMAKE_CURRENT_SOURCE_DIR}
70   PARAMS ${BOLT_TEST_PARAMS}
71   DEPENDS ${BOLT_TEST_DEPS}