[yaml2obj] - Allow placing local symbols after globals.
[llvm-complete.git] / test / CMakeLists.txt
bloba409cd31af54d8410197bdff635a1edd9c0c4e14
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-reduce
93           llvm-rtdyld
94           llvm-size
95           llvm-split
96           llvm-strings
97           llvm-strip
98           llvm-symbolizer
99           llvm-tblgen
100           llvm-undname
101           llvm-xray
102           not
103           obj2yaml
104           opt
105           sancov
106           sanstats
107           verify-uselistorder
108           yaml-bench
109           yaml2obj
110         )
112 if(TARGET llvm-lto)
113   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
114 endif()
116 # If Intel JIT events are supported, depend on a tool that tests the listener.
117 if( LLVM_USE_INTEL_JITEVENTS )
118   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-jitlistener)
119 endif( LLVM_USE_INTEL_JITEVENTS )
121 if(TARGET LLVMgold)
122   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LLVMgold)
123 endif()
125 if(TARGET llvm-go)
126   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-go)
127 endif()
129 if(TARGET LTO)
130   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LTO)
131 endif()
133 if(LLVM_BUILD_EXAMPLES)
134   list(APPEND LLVM_TEST_DEPENDS
135     Kaleidoscope-Ch3
136     Kaleidoscope-Ch4
137     Kaleidoscope-Ch5
138     Kaleidoscope-Ch6
139     Kaleidoscope-Ch7
140     )
141 endif()
143 if(TARGET ocaml_llvm)
144   # Clear all non-OCaml cross-target dependencies when building out-of-tree.
145   if(LLVM_OCAML_OUT_OF_TREE)
146     set(LLVM_TEST_DEPENDS)
147   endif()
149   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS}
150           ocaml_llvm
151           ocaml_llvm_all_backends
152           ocaml_llvm_analysis
153           ocaml_llvm_bitreader
154           ocaml_llvm_bitwriter
155           ocaml_llvm_executionengine
156           ocaml_llvm_irreader
157           ocaml_llvm_linker
158           ocaml_llvm_target
159           ocaml_llvm_ipo
160           ocaml_llvm_passmgr_builder
161           ocaml_llvm_scalar_opts
162           ocaml_llvm_transform_utils
163           ocaml_llvm_vectorize
164         )
165 endif()
167 add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS})
168 set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests")
170 add_lit_testsuite(check-llvm "Running the LLVM regression tests"
171   ${CMAKE_CURRENT_BINARY_DIR}
172   DEPENDS ${LLVM_TEST_DEPENDS}
173   )
174 set_target_properties(check-llvm PROPERTIES FOLDER "Tests")
176 add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
177   DEPENDS ${LLVM_TEST_DEPENDS}
178   )
180 # Setup a legacy alias for 'check-llvm'. This will likely change to be an
181 # alias for 'check-all' at some point in the future.
182 add_custom_target(check)
183 add_dependencies(check check-llvm)
184 set_target_properties(check PROPERTIES FOLDER "Tests")