Bump version to 19.1.0-rc3
[llvm-project.git] / llvm / test / CMakeLists.txt
blob6b7f2b58e603e9a16c8d3a907ee07d0eea5125bc
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   LLVM_INCLUDE_SPIRV_TOOLS_TESTS
28   LLVM_APPEND_VC_REV
29   LLVM_HAS_LOGF128
30   )
32 configure_lit_site_cfg(
33   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
34   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
35   MAIN_CONFIG
36   ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
37   PATHS
38   "CMAKE_OSX_SYSROOT"
39   "LLVM_SOURCE_DIR"
40   "LLVM_BINARY_DIR"
41   "LLVM_TOOLS_DIR"
42   "LLVM_LIBS_DIR"
43   "SHLIBDIR"
44   )
45 configure_lit_site_cfg(
46   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
47   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
48   MAIN_CONFIG
49   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
50   PATHS
51   "LLVM_SOURCE_DIR"
52   "LLVM_BINARY_DIR"
53   "LLVM_TOOLS_DIR"
54   "SHLIBDIR"
55   )
57 # Set the depends list as a variable so that it can grow conditionally.
58 # NOTE: Sync the substitutions in test/lit.cfg when adding to this list.
59 set(LLVM_TEST_DEPENDS
60           BugpointPasses
61           FileCheck
62           LLVMWindowsDriver
63           UnitTests
64           bugpoint
65           count
66           llc
67           lli
68           lli-child-target
69           llvm-addr2line
70           llvm-ar
71           llvm-as
72           llvm-bcanalyzer
73           llvm-bitcode-strip
74           llvm-c-test
75           llvm-cat
76           llvm-cfi-verify
77           llvm-config
78           llvm-cov
79           llvm-cvtres
80           llvm-cxxdump
81           llvm-cxxfilt
82           llvm-cxxmap
83           llvm-debuginfo-analyzer
84           llvm-debuginfod-find
85           llvm-diff
86           llvm-dis
87           llvm-dlltool
88           dsymutil
89           llvm-dwarfdump
90           llvm-dwarfutil
91           llvm-dwp
92           llvm-exegesis
93           llvm-extract
94           llvm-gsymutil
95           llvm-isel-fuzzer
96           llvm-ifs
97           llvm-install-name-tool
98           llvm-jitlink
99           llvm-lib
100           llvm-libtool-darwin
101           llvm-link
102           llvm-lipo
103           llvm-locstats
104           llvm-lto2
105           llvm-mc
106           llvm-mca
107           llvm-ml
108           llvm-modextract
109           llvm-mt
110           llvm-nm
111           llvm-objcopy
112           llvm-objdump
113           llvm-opt-fuzzer
114           llvm-opt-report
115           llvm-otool
116           llvm-pdbutil
117           llvm-profdata
118           llvm-profgen
119           llvm-ranlib
120           llvm-rc
121           llvm-readobj
122           llvm-readelf
123           llvm-reduce
124           llvm-remarkutil
125           llvm-rtdyld
126           llvm-sim
127           llvm-size
128           llvm-split
129           llvm-stress
130           llvm-strings
131           llvm-strip
132           llvm-symbolizer
133           llvm-tblgen
134           llvm-readtapi
135           llvm-tli-checker
136           llvm-undname
137           llvm-windres
138           llvm-xray
139           not
140           obj2yaml
141           opt
142           sancov
143           sanstats
144           split-file
145           verify-uselistorder
146           yaml-bench
147           yaml2obj
148         )
150 if(TARGET llvm-lto)
151   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
152 endif()
154 if(TARGET llvm-driver)
155   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-driver)
156 endif()
158 # If Intel JIT events are supported, depend on a tool that tests the listener.
159 if( LLVM_USE_INTEL_JITEVENTS )
160   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-jitlistener)
161 endif( LLVM_USE_INTEL_JITEVENTS )
163 if(TARGET LLVMgold)
164   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LLVMgold)
165 endif()
167 if(TARGET LTO)
168   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LTO)
169 endif()
171 if(LLVM_BUILD_EXAMPLES)
172   list(APPEND LLVM_TEST_DEPENDS
173     Kaleidoscope-Ch3
174     Kaleidoscope-Ch4
175     Kaleidoscope-Ch5
176     Kaleidoscope-Ch6
177     Kaleidoscope-Ch7
178     LLJITWithThinLTOSummaries
179     OrcV2CBindingsBasicUsage
180     OrcV2CBindingsAddObjectFile
181     OrcV2CBindingsRemovableCode
182     OrcV2CBindingsLazy
183     OrcV2CBindingsVeryLazy
184     )
185   if(CMAKE_HOST_UNIX)
186     list(APPEND LLVM_TEST_DEPENDS
187       LLJITWithRemoteDebugging
188       )
189   endif()
190   if (NOT WIN32)
191     list(APPEND LLVM_TEST_DEPENDS
192       Bye
193       ExampleIRTransforms
194       )
195   endif()
196 endif()
198 if(TARGET ocaml_llvm)
199   # Clear all non-OCaml cross-target dependencies when building out-of-tree.
200   if(LLVM_OCAML_OUT_OF_TREE)
201     set(LLVM_TEST_DEPENDS)
202   endif()
204   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS}
205           ocaml_llvm
206           ocaml_llvm_all_backends
207           ocaml_llvm_analysis
208           ocaml_llvm_bitreader
209           ocaml_llvm_bitwriter
210           ocaml_llvm_executionengine
211           ocaml_llvm_irreader
212           ocaml_llvm_linker
213           ocaml_llvm_passbuilder
214           ocaml_llvm_target
215           ocaml_llvm_transform_utils
216         )
217 endif()
219 if (LLVM_INCLUDE_DXIL_TESTS)
220   list(APPEND LLVM_TEST_DEPENDS dxil-dis)
221 endif()
223 if(LLVM_ENABLE_HTTPLIB)
224   list(APPEND LLVM_TEST_DEPENDS llvm-debuginfod)
225 endif()
227 if (LLVM_INCLUDE_SPIRV_TOOLS_TESTS)
228   list(APPEND LLVM_TEST_DEPENDS spirv-dis)
229   list(APPEND LLVM_TEST_DEPENDS spirv-val)
230 endif()
232 add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS})
233 set_target_properties(llvm-test-depends PROPERTIES FOLDER "LLVM/Tests")
235 if(LLVM_BUILD_TOOLS)
236   set(exclude_from_check_all "")
237 else()
238   set(exclude_from_check_all "EXCLUDE_FROM_CHECK_ALL")
239 endif()
241 add_lit_testsuite(check-llvm "Running the LLVM regression tests"
242   ${CMAKE_CURRENT_BINARY_DIR}
243   ${exclude_from_check_all}
244   DEPENDS ${LLVM_TEST_DEPENDS}
245   )
246 set_target_properties(check-llvm PROPERTIES FOLDER "LLVM/Tests")
248 add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
249   ${exclude_from_check_all}
250   DEPENDS ${LLVM_TEST_DEPENDS}
251   FOLDER "Tests/Subdirectories"
252   )
254 # Setup an alias for 'check-all'.
255 add_custom_target(check)
256 add_dependencies(check check-all)
257 set_target_properties(check PROPERTIES FOLDER "LLVM/Tests")