[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / llvm / test / CMakeLists.txt
blob86ca20ada7b80ace03be71cde70dfbbb55bd6c3d
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_LIBXML2
12   LLVM_INCLUDE_GO_TESTS
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_HAVE_TF_AOT
20   LLVM_HAVE_TF_API
21   LLVM_INLINER_MODEL_AUTOGENERATED
22   LLVM_RAEVICT_MODEL_AUTOGENERATED
23   LLVM_ENABLE_EXPENSIVE_CHECKS
24   LLVM_INCLUDE_DXIL_TESTS
25   LLVM_TOOL_LLVM_DRIVER_BUILD
26   )
28 configure_lit_site_cfg(
29   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
30   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
31   MAIN_CONFIG
32   ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
33   PATHS
34   "CMAKE_OSX_SYSROOT"
35   "LLVM_SOURCE_DIR"
36   "LLVM_BINARY_DIR"
37   "LLVM_TOOLS_DIR"
38   "LLVM_LIBS_DIR"
39   "SHLIBDIR"
40   )
41 configure_lit_site_cfg(
42   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
43   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
44   MAIN_CONFIG
45   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
46   PATHS
47   "LLVM_SOURCE_DIR"
48   "LLVM_BINARY_DIR"
49   "LLVM_TOOLS_DIR"
50   "SHLIBDIR"
51   )
53 # Set the depends list as a variable so that it can grow conditionally.
54 # NOTE: Sync the substitutions in test/lit.cfg when adding to this list.
55 set(LLVM_TEST_DEPENDS
56           BugpointPasses
57           FileCheck
58           LLVMHello
59           LLVMWindowsDriver
60           UnitTests
61           bugpoint
62           count
63           llc
64           lli
65           lli-child-target
66           llvm-addr2line
67           llvm-ar
68           llvm-as
69           llvm-bcanalyzer
70           llvm-bitcode-strip
71           llvm-c-test
72           llvm-cat
73           llvm-cfi-verify
74           llvm-config
75           llvm-cov
76           llvm-cvtres
77           llvm-cxxdump
78           llvm-cxxfilt
79           llvm-cxxmap
80           llvm-debuginfod-find
81           llvm-diff
82           llvm-dis
83           llvm-dlltool
84           dsymutil
85           llvm-dwarfdump
86           llvm-dwarfutil
87           llvm-dwp
88           llvm-exegesis
89           llvm-extract
90           llvm-gsymutil
91           llvm-isel-fuzzer
92           llvm-ifs
93           llvm-install-name-tool
94           llvm-jitlink
95           llvm-lib
96           llvm-libtool-darwin
97           llvm-link
98           llvm-lipo
99           llvm-locstats
100           llvm-lto2
101           llvm-mc
102           llvm-mca
103           llvm-ml
104           llvm-modextract
105           llvm-mt
106           llvm-nm
107           llvm-objcopy
108           llvm-objdump
109           llvm-opt-fuzzer
110           llvm-opt-report
111           llvm-otool
112           llvm-pdbutil
113           llvm-profdata
114           llvm-profgen
115           llvm-ranlib
116           llvm-rc
117           llvm-readobj
118           llvm-readelf
119           llvm-reduce
120           llvm-remark-size-diff
121           llvm-rtdyld
122           llvm-sim
123           llvm-size
124           llvm-split
125           llvm-stress
126           llvm-strings
127           llvm-strip
128           llvm-symbolizer
129           llvm-tblgen
130           llvm-tapi-diff
131           llvm-tli-checker
132           llvm-undname
133           llvm-windres
134           llvm-xray
135           not
136           obj2yaml
137           opt
138           sancov
139           sanstats
140           split-file
141           verify-uselistorder
142           yaml-bench
143           yaml2obj
144         )
146 if(TARGET llvm-lto)
147   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
148 endif()
150 if(TARGET llvm-driver)
151   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-driver)
152 endif()
154 # If Intel JIT events are supported, depend on a tool that tests the listener.
155 if( LLVM_USE_INTEL_JITEVENTS )
156   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-jitlistener)
157 endif( LLVM_USE_INTEL_JITEVENTS )
159 if(TARGET LLVMgold)
160   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LLVMgold)
161 endif()
163 if(TARGET llvm-go)
164   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-go)
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     OrcV2CBindingsReflectProcessSymbols
183     OrcV2CBindingsLazy
184     OrcV2CBindingsVeryLazy
185     )
186   if(CMAKE_HOST_UNIX)
187     list(APPEND LLVM_TEST_DEPENDS
188       LLJITWithRemoteDebugging
189       )
190   endif()
191   if (NOT WIN32)
192     list(APPEND LLVM_TEST_DEPENDS
193       Bye
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_target
214           ocaml_llvm_ipo
215           ocaml_llvm_passmgr_builder
216           ocaml_llvm_scalar_opts
217           ocaml_llvm_transform_utils
218           ocaml_llvm_vectorize
219         )
220 endif()
222 if (LLVM_INCLUDE_DXIL_TESTS)
223   list(APPEND LLVM_TEST_DEPENDS dxil-dis)
224 endif()
226 add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS})
227 set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests")
229 if(LLVM_BUILD_TOOLS)
230   set(exclude_from_check_all "")
231 else()
232   set(exclude_from_check_all "EXCLUDE_FROM_CHECK_ALL")
233 endif()
235 add_lit_testsuite(check-llvm "Running the LLVM regression tests"
236   ${CMAKE_CURRENT_BINARY_DIR}
237   ${exclude_from_check_all}
238   DEPENDS ${LLVM_TEST_DEPENDS}
239   )
240 set_target_properties(check-llvm PROPERTIES FOLDER "Tests")
242 add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
243   ${exclude_from_check_all}
244   DEPENDS ${LLVM_TEST_DEPENDS}
245   FOLDER "Tests/Subdirectories"
246   )
248 # Setup an alias for 'check-all'.
249 add_custom_target(check)
250 add_dependencies(check check-all)
251 set_target_properties(check PROPERTIES FOLDER "Tests")