Recommit "rL366894: [yaml2obj] - Allow custom fields for the SHT_UNDEF sections."
[llvm-complete.git] / test / CMakeLists.txt
blob03d154e39d02b064b9ec9321e46688a0ed8f3a47
1 llvm_canonicalize_cmake_booleans(
2   BUILD_SHARED_LIBS
3   HAVE_LIBXAR
4   HAVE_LIBZ
5   HAVE_OCAMLOPT
6   HAVE_OCAML_OUNIT
7   LLVM_ENABLE_DIA_SDK
8   LLVM_ENABLE_FFI
9   LLVM_ENABLE_THREADS
10   LLVM_INCLUDE_GO_TESTS
11   LLVM_LIBXML2_ENABLED
12   LLVM_LINK_LLVM_DYLIB
13   LLVM_TOOL_LTO_BUILD
14   LLVM_USE_INTEL_JITEVENTS
15   LLVM_BUILD_EXAMPLES
16   LLVM_ENABLE_PLUGINS
17   )
19 configure_lit_site_cfg(
20   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
21   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
22   MAIN_CONFIG
23   ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
24   )
25 configure_lit_site_cfg(
26   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
27   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
28   MAIN_CONFIG
29   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
30   )
32 # Don't include check-llvm into check-all without LLVM_BUILD_TOOLS.
33 if(NOT LLVM_BUILD_TOOLS)
34   set(EXCLUDE_FROM_ALL ON)
35 endif()
37 # Set the depends list as a variable so that it can grow conditionally.
38 # NOTE: Sync the substitutions in test/lit.cfg when adding to this list.
39 set(LLVM_TEST_DEPENDS
40           BugpointPasses
41           FileCheck
42           LLVMHello
43           UnitTests
44           bugpoint
45           count
46           llc
47           lli
48           lli-child-target
49           llvm-addr2line
50           llvm-ar
51           llvm-as
52           llvm-bcanalyzer
53           llvm-c-test
54           llvm-cat
55           llvm-cfi-verify
56           llvm-config
57           llvm-cov
58           llvm-cvtres
59           llvm-cxxdump
60           llvm-cxxfilt
61           llvm-cxxmap
62           llvm-diff
63           llvm-dis
64           llvm-dlltool
65           dsymutil
66           llvm-dwarfdump
67           llvm-dwp
68           llvm-elfabi
69           llvm-exegesis
70           llvm-extract
71           llvm-isel-fuzzer
72           llvm-jitlink
73           llvm-lib
74           llvm-link
75           llvm-lipo
76           llvm-lto2
77           llvm-mc
78           llvm-mca
79           llvm-modextract
80           llvm-mt
81           llvm-nm
82           llvm-objcopy
83           llvm-objdump
84           llvm-opt-fuzzer
85           llvm-opt-report
86           llvm-pdbutil
87           llvm-profdata
88           llvm-ranlib
89           llvm-rc
90           llvm-readobj
91           llvm-readelf
92           llvm-rtdyld
93           llvm-size
94           llvm-split
95           llvm-strings
96           llvm-strip
97           llvm-symbolizer
98           llvm-tblgen
99           llvm-undname
100           llvm-xray
101           not
102           obj2yaml
103           opt
104           sancov
105           sanstats
106           verify-uselistorder
107           yaml-bench
108           yaml2obj
109         )
111 if(TARGET llvm-lto)
112   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
113 endif()
115 # If Intel JIT events are supported, depend on a tool that tests the listener.
116 if( LLVM_USE_INTEL_JITEVENTS )
117   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-jitlistener)
118 endif( LLVM_USE_INTEL_JITEVENTS )
120 if(TARGET LLVMgold)
121   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LLVMgold)
122 endif()
124 if(TARGET llvm-go)
125   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-go)
126 endif()
128 if(TARGET LTO)
129   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LTO)
130 endif()
132 if(LLVM_BUILD_EXAMPLES)
133   list(APPEND LLVM_TEST_DEPENDS
134     Kaleidoscope-Ch3
135     Kaleidoscope-Ch4
136     Kaleidoscope-Ch5
137     Kaleidoscope-Ch6
138     Kaleidoscope-Ch7
139     )
140 endif()
142 if(TARGET ocaml_llvm)
143   # Clear all non-OCaml cross-target dependencies when building out-of-tree.
144   if(LLVM_OCAML_OUT_OF_TREE)
145     set(LLVM_TEST_DEPENDS)
146   endif()
148   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS}
149           ocaml_llvm
150           ocaml_llvm_all_backends
151           ocaml_llvm_analysis
152           ocaml_llvm_bitreader
153           ocaml_llvm_bitwriter
154           ocaml_llvm_executionengine
155           ocaml_llvm_irreader
156           ocaml_llvm_linker
157           ocaml_llvm_target
158           ocaml_llvm_ipo
159           ocaml_llvm_passmgr_builder
160           ocaml_llvm_scalar_opts
161           ocaml_llvm_transform_utils
162           ocaml_llvm_vectorize
163         )
164 endif()
166 add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS})
167 set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests")
169 add_lit_testsuite(check-llvm "Running the LLVM regression tests"
170   ${CMAKE_CURRENT_BINARY_DIR}
171   DEPENDS ${LLVM_TEST_DEPENDS}
172   )
173 set_target_properties(check-llvm PROPERTIES FOLDER "Tests")
175 add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
176   DEPENDS ${LLVM_TEST_DEPENDS}
177   )
179 # Setup a legacy alias for 'check-llvm'. This will likely change to be an
180 # alias for 'check-all' at some point in the future.
181 add_custom_target(check)
182 add_dependencies(check check-llvm)
183 set_target_properties(check PROPERTIES FOLDER "Tests")