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