[RISCV] emit .option directive for functions with target features which differ from...
[llvm-project.git] / llvm / test / CMakeLists.txt
blob0715e72d79f6b3f472102d442aab88d78b758b1b
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_ENABLE_REVERSE_ITERATION
26   LLVM_INCLUDE_DXIL_TESTS
27   LLVM_TOOL_LLVM_DRIVER_BUILD
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_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")