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