Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / CMakeLists.txt
blob8aa652240081ce543b804b69d5f0a5e39cd124ae
1 llvm_canonicalize_cmake_booleans(
2   BUILD_SHARED_LIBS
3   HAVE_OCAMLOPT
4   LLVM_ENABLE_DIA_SDK
5   LLVM_ENABLE_FFI
6   LLVM_ENABLE_THREADS
7   LLVM_ENABLE_CURL
8   LLVM_ENABLE_HTTPLIB
9   LLVM_ENABLE_ZLIB
10   LLVM_ENABLE_ZSTD
11   LLVM_ENABLE_LIBXML2
12   LLVM_LINK_LLVM_DYLIB
13   LLVM_TOOL_LTO_BUILD
14   LLVM_USE_INTEL_JITEVENTS
15   LLVM_BUILD_EXAMPLES
16   LLVM_ENABLE_PLUGINS
17   LLVM_BYE_LINK_INTO_TOOLS
18   LLVM_EXAMPLEIRTRANSFORMS_LINK_INTO_TOOLS
19   LLVM_HAVE_TF_AOT
20   LLVM_HAVE_TFLITE
21   LLVM_INLINER_MODEL_AUTOGENERATED
22   LLVM_RAEVICT_MODEL_AUTOGENERATED
23   LLVM_ENABLE_EXPENSIVE_CHECKS
24   LLVM_ENABLE_REVERSE_ITERATION
25   LLVM_INCLUDE_DXIL_TESTS
26   LLVM_TOOL_LLVM_DRIVER_BUILD
27   )
29 configure_lit_site_cfg(
30   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
31   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
32   MAIN_CONFIG
33   ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
34   PATHS
35   "CMAKE_OSX_SYSROOT"
36   "LLVM_SOURCE_DIR"
37   "LLVM_BINARY_DIR"
38   "LLVM_TOOLS_DIR"
39   "LLVM_LIBS_DIR"
40   "SHLIBDIR"
41   )
42 configure_lit_site_cfg(
43   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
44   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
45   MAIN_CONFIG
46   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
47   PATHS
48   "LLVM_SOURCE_DIR"
49   "LLVM_BINARY_DIR"
50   "LLVM_TOOLS_DIR"
51   "SHLIBDIR"
52   )
54 # Set the depends list as a variable so that it can grow conditionally.
55 # NOTE: Sync the substitutions in test/lit.cfg when adding to this list.
56 set(LLVM_TEST_DEPENDS
57           BugpointPasses
58           FileCheck
59           LLVMHello
60           LLVMWindowsDriver
61           UnitTests
62           bugpoint
63           count
64           llc
65           lli
66           lli-child-target
67           llvm-addr2line
68           llvm-ar
69           llvm-as
70           llvm-bcanalyzer
71           llvm-bitcode-strip
72           llvm-c-test
73           llvm-cat
74           llvm-cfi-verify
75           llvm-config
76           llvm-cov
77           llvm-cvtres
78           llvm-cxxdump
79           llvm-cxxfilt
80           llvm-cxxmap
81           llvm-debuginfo-analyzer
82           llvm-debuginfod-find
83           llvm-diff
84           llvm-dis
85           llvm-dlltool
86           dsymutil
87           llvm-dwarfdump
88           llvm-dwarfutil
89           llvm-dwp
90           llvm-exegesis
91           llvm-extract
92           llvm-gsymutil
93           llvm-isel-fuzzer
94           llvm-ifs
95           llvm-install-name-tool
96           llvm-jitlink
97           llvm-lib
98           llvm-libtool-darwin
99           llvm-link
100           llvm-lipo
101           llvm-locstats
102           llvm-lto2
103           llvm-mc
104           llvm-mca
105           llvm-ml
106           llvm-modextract
107           llvm-mt
108           llvm-nm
109           llvm-objcopy
110           llvm-objdump
111           llvm-opt-fuzzer
112           llvm-opt-report
113           llvm-otool
114           llvm-pdbutil
115           llvm-profdata
116           llvm-profgen
117           llvm-ranlib
118           llvm-rc
119           llvm-readobj
120           llvm-readelf
121           llvm-reduce
122           llvm-remarkutil
123           llvm-rtdyld
124           llvm-sim
125           llvm-size
126           llvm-split
127           llvm-stress
128           llvm-strings
129           llvm-strip
130           llvm-symbolizer
131           llvm-tblgen
132           llvm-readtapi
133           llvm-tli-checker
134           llvm-undname
135           llvm-windres
136           llvm-xray
137           not
138           obj2yaml
139           opt
140           sancov
141           sanstats
142           split-file
143           verify-uselistorder
144           yaml-bench
145           yaml2obj
146         )
148 if(TARGET llvm-lto)
149   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
150 endif()
152 if(TARGET llvm-driver)
153   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-driver)
154 endif()
156 # If Intel JIT events are supported, depend on a tool that tests the listener.
157 if( LLVM_USE_INTEL_JITEVENTS )
158   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-jitlistener)
159 endif( LLVM_USE_INTEL_JITEVENTS )
161 if(TARGET LLVMgold)
162   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LLVMgold)
163 endif()
165 if(TARGET LTO)
166   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LTO)
167 endif()
169 if(LLVM_BUILD_EXAMPLES)
170   list(APPEND LLVM_TEST_DEPENDS
171     Kaleidoscope-Ch3
172     Kaleidoscope-Ch4
173     Kaleidoscope-Ch5
174     Kaleidoscope-Ch6
175     Kaleidoscope-Ch7
176     LLJITWithThinLTOSummaries
177     OrcV2CBindingsBasicUsage
178     OrcV2CBindingsAddObjectFile
179     OrcV2CBindingsRemovableCode
180     OrcV2CBindingsLazy
181     OrcV2CBindingsVeryLazy
182     )
183   if(CMAKE_HOST_UNIX)
184     list(APPEND LLVM_TEST_DEPENDS
185       LLJITWithRemoteDebugging
186       )
187   endif()
188   if (NOT WIN32)
189     list(APPEND LLVM_TEST_DEPENDS
190       Bye
191       ExampleIRTransforms
192       )
193   endif()
194 endif()
196 if(TARGET ocaml_llvm)
197   # Clear all non-OCaml cross-target dependencies when building out-of-tree.
198   if(LLVM_OCAML_OUT_OF_TREE)
199     set(LLVM_TEST_DEPENDS)
200   endif()
202   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS}
203           ocaml_llvm
204           ocaml_llvm_all_backends
205           ocaml_llvm_analysis
206           ocaml_llvm_bitreader
207           ocaml_llvm_bitwriter
208           ocaml_llvm_executionengine
209           ocaml_llvm_irreader
210           ocaml_llvm_linker
211           ocaml_llvm_passbuilder
212           ocaml_llvm_target
213           ocaml_llvm_transform_utils
214         )
215 endif()
217 if (LLVM_INCLUDE_DXIL_TESTS)
218   list(APPEND LLVM_TEST_DEPENDS dxil-dis)
219 endif()
221 if(LLVM_ENABLE_HTTPLIB)
222   list(APPEND LLVM_TEST_DEPENDS llvm-debuginfod)
223 endif()
225 add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS})
226 set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests")
228 if(LLVM_BUILD_TOOLS)
229   set(exclude_from_check_all "")
230 else()
231   set(exclude_from_check_all "EXCLUDE_FROM_CHECK_ALL")
232 endif()
234 add_lit_testsuite(check-llvm "Running the LLVM regression tests"
235   ${CMAKE_CURRENT_BINARY_DIR}
236   ${exclude_from_check_all}
237   DEPENDS ${LLVM_TEST_DEPENDS}
238   )
239 set_target_properties(check-llvm PROPERTIES FOLDER "Tests")
241 add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
242   ${exclude_from_check_all}
243   DEPENDS ${LLVM_TEST_DEPENDS}
244   FOLDER "Tests/Subdirectories"
245   )
247 # Setup an alias for 'check-all'.
248 add_custom_target(check)
249 add_dependencies(check check-all)
250 set_target_properties(check PROPERTIES FOLDER "Tests")