[NFC][Py Reformat] Reformat python files in llvm
[llvm-project.git] / llvm / test / CMakeLists.txt
blob089d374f282d785124bfedf3c86d3caf204cf076
1 llvm_canonicalize_cmake_booleans(
2   BUILD_SHARED_LIBS
3   LLVM_HAVE_LIBXAR
4   HAVE_OCAMLOPT
5   LLVM_ENABLE_DIA_SDK
6   LLVM_ENABLE_FFI
7   LLVM_ENABLE_THREADS
8   LLVM_ENABLE_CURL
9   LLVM_ENABLE_HTTPLIB
10   LLVM_ENABLE_ZLIB
11   LLVM_ENABLE_ZSTD
12   LLVM_ENABLE_LIBXML2
13   LLVM_LINK_LLVM_DYLIB
14   LLVM_TOOL_LTO_BUILD
15   LLVM_USE_INTEL_JITEVENTS
16   LLVM_BUILD_EXAMPLES
17   LLVM_ENABLE_PLUGINS
18   LLVM_BYE_LINK_INTO_TOOLS
19   LLVM_EXAMPLEIRTRANSFORMS_LINK_INTO_TOOLS
20   LLVM_HAVE_TF_AOT
21   LLVM_HAVE_TFLITE
22   LLVM_INLINER_MODEL_AUTOGENERATED
23   LLVM_RAEVICT_MODEL_AUTOGENERATED
24   LLVM_ENABLE_EXPENSIVE_CHECKS
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-remark-size-diff
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-tapi-diff
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_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")