Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / CMakeLists.txt
blob56490a7c3222a768c5ec303407e2695664c4d4a9
1 llvm_canonicalize_cmake_booleans(
2   ENABLE_BACKTRACES
3   LLVM_ENABLE_ZLIB
4   LLVM_ENABLE_ZSTD
5   LLVM_ENABLE_LIBXML2
6   LLD_DEFAULT_LD_LLD_IS_MINGW
7   LLVM_BUILD_EXAMPLES
8   LLVM_ENABLE_PLUGINS
9   LLVM_BYE_LINK_INTO_TOOLS
10   )
12 configure_lit_site_cfg(
13   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
14   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
15   MAIN_CONFIG
16   ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
17   PATHS
18   "LLVM_SOURCE_DIR"
19   "LLVM_BINARY_DIR"
20   "LLVM_TOOLS_DIR"
21   "LLVM_LIBS_DIR"
22   "SHLIBDIR"
23   "LLVM_LIT_TOOLS_DIR"
24   "LLD_BINARY_DIR"
25   "CURRENT_LIBS_DIR"
26   "CURRENT_TOOLS_DIR"
27   "LLD_SOURCE_DIR"
28   )
29 configure_lit_site_cfg(
30   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
31   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
32   MAIN_CONFIG
33   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
34   PATHS
35   "SHLIBDIR"
36   "LLD_BINARY_DIR"
37   "LLD_SOURCE_DIR"
40 set(LLD_TEST_DEPS lld)
41 if (NOT LLD_BUILT_STANDALONE)
42   list(APPEND LLD_TEST_DEPS
43     FileCheck
44     LLDUnitTests
45     count
46     dsymutil
47     llc
48     llvm-ar
49     llvm-as
50     llvm-bcanalyzer
51     llvm-config
52     llvm-cvtres
53     llvm-dis
54     llvm-dlltool
55     llvm-dwarfdump
56     llvm-lib
57     llvm-lipo
58     llvm-mc
59     llvm-nm
60     llvm-objcopy
61     llvm-objdump
62     llvm-otool
63     llvm-pdbutil
64     llvm-profdata
65     llvm-readelf
66     llvm-readobj
67     llvm-strip
68     llvm-symbolizer
69     not
70     obj2yaml
71     opt
72     split-file
73     yaml2obj
74     )
75     if (NOT WIN32 AND LLVM_BUILD_EXAMPLES)
76       list(APPEND LLD_TEST_DEPS
77         Bye
78         )
79     endif()
80 endif()
82 add_lit_testsuite(check-lld "Running lld test suite"
83   ${CMAKE_CURRENT_BINARY_DIR}
84   DEPENDS ${LLD_TEST_DEPS}
85   )
86 set_target_properties(check-lld PROPERTIES FOLDER "lld tests")
88 add_custom_target(lld-test-depends DEPENDS ${LLD_TEST_DEPS})
89 set_target_properties(lld-test-depends PROPERTIES FOLDER "lld tests")
91 add_lit_testsuites(LLD ${CMAKE_CURRENT_SOURCE_DIR}
92   DEPENDS ${LLD_TEST_DEPS}
93   )
95 # Add a legacy target spelling: lld-test
96 add_custom_target(lld-test)
97 add_dependencies(lld-test check-lld)
98 set_target_properties(lld-test PROPERTIES FOLDER "lld tests")