xref: /aosp_15_r20/external/llvm/test/CMakeLists.txt (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Workerif(LLVM_BUILD_EXAMPLES)
2*9880d681SAndroid Build Coastguard Worker  set(ENABLE_EXAMPLES 1)
3*9880d681SAndroid Build Coastguard Workerendif()
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerconfigure_lit_site_cfg(
6*9880d681SAndroid Build Coastguard Worker  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
7*9880d681SAndroid Build Coastguard Worker  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
8*9880d681SAndroid Build Coastguard Worker  )
9*9880d681SAndroid Build Coastguard Workerconfigure_lit_site_cfg(
10*9880d681SAndroid Build Coastguard Worker  ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
11*9880d681SAndroid Build Coastguard Worker  ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
12*9880d681SAndroid Build Coastguard Worker  )
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker# Don't include check-llvm into check-all without LLVM_BUILD_TOOLS.
15*9880d681SAndroid Build Coastguard Workerif(NOT LLVM_BUILD_TOOLS)
16*9880d681SAndroid Build Coastguard Worker  set(EXCLUDE_FROM_ALL ON)
17*9880d681SAndroid Build Coastguard Workerendif()
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker# Set the depends list as a variable so that it can grow conditionally.
20*9880d681SAndroid Build Coastguard Worker# NOTE: Sync the substitutions in test/lit.cfg when adding to this list.
21*9880d681SAndroid Build Coastguard Workerset(LLVM_TEST_DEPENDS
22*9880d681SAndroid Build Coastguard Worker          BugpointPasses
23*9880d681SAndroid Build Coastguard Worker          FileCheck
24*9880d681SAndroid Build Coastguard Worker          LLVMHello
25*9880d681SAndroid Build Coastguard Worker          UnitTests
26*9880d681SAndroid Build Coastguard Worker          bugpoint
27*9880d681SAndroid Build Coastguard Worker          count
28*9880d681SAndroid Build Coastguard Worker          llc
29*9880d681SAndroid Build Coastguard Worker          lli
30*9880d681SAndroid Build Coastguard Worker          lli-child-target
31*9880d681SAndroid Build Coastguard Worker          llvm-ar
32*9880d681SAndroid Build Coastguard Worker          llvm-as
33*9880d681SAndroid Build Coastguard Worker          llvm-bcanalyzer
34*9880d681SAndroid Build Coastguard Worker          llvm-c-test
35*9880d681SAndroid Build Coastguard Worker          llvm-config
36*9880d681SAndroid Build Coastguard Worker          llvm-cov
37*9880d681SAndroid Build Coastguard Worker          llvm-cxxdump
38*9880d681SAndroid Build Coastguard Worker          llvm-diff
39*9880d681SAndroid Build Coastguard Worker          llvm-dis
40*9880d681SAndroid Build Coastguard Worker          llvm-dsymutil
41*9880d681SAndroid Build Coastguard Worker          llvm-dwarfdump
42*9880d681SAndroid Build Coastguard Worker          llvm-dwp
43*9880d681SAndroid Build Coastguard Worker          llvm-extract
44*9880d681SAndroid Build Coastguard Worker          llvm-lib
45*9880d681SAndroid Build Coastguard Worker          llvm-link
46*9880d681SAndroid Build Coastguard Worker          llvm-mc
47*9880d681SAndroid Build Coastguard Worker          llvm-mcmarkup
48*9880d681SAndroid Build Coastguard Worker          llvm-nm
49*9880d681SAndroid Build Coastguard Worker          llvm-objdump
50*9880d681SAndroid Build Coastguard Worker          llvm-pdbdump
51*9880d681SAndroid Build Coastguard Worker          llvm-profdata
52*9880d681SAndroid Build Coastguard Worker          llvm-ranlib
53*9880d681SAndroid Build Coastguard Worker          llvm-readobj
54*9880d681SAndroid Build Coastguard Worker          llvm-rtdyld
55*9880d681SAndroid Build Coastguard Worker          llvm-size
56*9880d681SAndroid Build Coastguard Worker          llvm-split
57*9880d681SAndroid Build Coastguard Worker          llvm-symbolizer
58*9880d681SAndroid Build Coastguard Worker          llvm-tblgen
59*9880d681SAndroid Build Coastguard Worker          not
60*9880d681SAndroid Build Coastguard Worker          obj2yaml
61*9880d681SAndroid Build Coastguard Worker          opt
62*9880d681SAndroid Build Coastguard Worker          sancov
63*9880d681SAndroid Build Coastguard Worker          sanstats
64*9880d681SAndroid Build Coastguard Worker          verify-uselistorder
65*9880d681SAndroid Build Coastguard Worker          yaml-bench
66*9880d681SAndroid Build Coastguard Worker          yaml2obj
67*9880d681SAndroid Build Coastguard Worker        )
68*9880d681SAndroid Build Coastguard Worker
69*9880d681SAndroid Build Coastguard Workerif(TARGET llvm-lto)
70*9880d681SAndroid Build Coastguard Worker  set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
71*9880d681SAndroid Build Coastguard Workerendif()
72*9880d681SAndroid Build Coastguard Worker
73*9880d681SAndroid Build Coastguard Worker# If Intel JIT events are supported, depend on a tool that tests the listener.
74*9880d681SAndroid Build Coastguard Workerif( LLVM_USE_INTEL_JITEVENTS )
75*9880d681SAndroid Build Coastguard Worker  set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-jitlistener)
76*9880d681SAndroid Build Coastguard Workerendif( LLVM_USE_INTEL_JITEVENTS )
77*9880d681SAndroid Build Coastguard Worker
78*9880d681SAndroid Build Coastguard Workerif(TARGET LLVMgold)
79*9880d681SAndroid Build Coastguard Worker  set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LLVMgold)
80*9880d681SAndroid Build Coastguard Workerendif()
81*9880d681SAndroid Build Coastguard Worker
82*9880d681SAndroid Build Coastguard Workerif(TARGET llvm-go)
83*9880d681SAndroid Build Coastguard Worker  set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-go)
84*9880d681SAndroid Build Coastguard Workerendif()
85*9880d681SAndroid Build Coastguard Worker
86*9880d681SAndroid Build Coastguard Workerif(TARGET LTO)
87*9880d681SAndroid Build Coastguard Worker  set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LTO)
88*9880d681SAndroid Build Coastguard Workerendif()
89*9880d681SAndroid Build Coastguard Worker
90*9880d681SAndroid Build Coastguard Workerif(TARGET ocaml_llvm)
91*9880d681SAndroid Build Coastguard Worker  set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS}
92*9880d681SAndroid Build Coastguard Worker          ocaml_llvm
93*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_all_backends
94*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_analysis
95*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_bitreader
96*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_bitwriter
97*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_executionengine
98*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_irreader
99*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_linker
100*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_target
101*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_ipo
102*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_passmgr_builder
103*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_scalar_opts
104*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_transform_utils
105*9880d681SAndroid Build Coastguard Worker          ocaml_llvm_vectorize
106*9880d681SAndroid Build Coastguard Worker        )
107*9880d681SAndroid Build Coastguard Workerendif()
108*9880d681SAndroid Build Coastguard Worker
109*9880d681SAndroid Build Coastguard Workerif(LLVM_BUILD_EXAMPLES)
110*9880d681SAndroid Build Coastguard Worker  list(APPEND LLVM_TEST_DEPENDS
111*9880d681SAndroid Build Coastguard Worker    Kaleidoscope-Ch3
112*9880d681SAndroid Build Coastguard Worker    Kaleidoscope-Ch4
113*9880d681SAndroid Build Coastguard Worker    Kaleidoscope-Ch5
114*9880d681SAndroid Build Coastguard Worker    Kaleidoscope-Ch6
115*9880d681SAndroid Build Coastguard Worker    Kaleidoscope-Ch7
116*9880d681SAndroid Build Coastguard Worker    )
117*9880d681SAndroid Build Coastguard Workerendif()
118*9880d681SAndroid Build Coastguard Worker
119*9880d681SAndroid Build Coastguard Workeradd_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS})
120*9880d681SAndroid Build Coastguard Workerset_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests")
121*9880d681SAndroid Build Coastguard Worker
122*9880d681SAndroid Build Coastguard Workeradd_lit_testsuite(check-llvm "Running the LLVM regression tests"
123*9880d681SAndroid Build Coastguard Worker  ${CMAKE_CURRENT_BINARY_DIR}
124*9880d681SAndroid Build Coastguard Worker  PARAMS llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
125*9880d681SAndroid Build Coastguard Worker         llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
126*9880d681SAndroid Build Coastguard Worker  DEPENDS ${LLVM_TEST_DEPENDS}
127*9880d681SAndroid Build Coastguard Worker  )
128*9880d681SAndroid Build Coastguard Workerset_target_properties(check-llvm PROPERTIES FOLDER "Tests")
129*9880d681SAndroid Build Coastguard Worker
130*9880d681SAndroid Build Coastguard Workeradd_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
131*9880d681SAndroid Build Coastguard Worker  PARAMS llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
132*9880d681SAndroid Build Coastguard Worker         llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
133*9880d681SAndroid Build Coastguard Worker  DEPENDS ${LLVM_TEST_DEPENDS}
134*9880d681SAndroid Build Coastguard Worker  )
135*9880d681SAndroid Build Coastguard Worker
136*9880d681SAndroid Build Coastguard Worker# Setup a legacy alias for 'check-llvm'. This will likely change to be an
137*9880d681SAndroid Build Coastguard Worker# alias for 'check-all' at some point in the future.
138*9880d681SAndroid Build Coastguard Workeradd_custom_target(check)
139*9880d681SAndroid Build Coastguard Workeradd_dependencies(check check-llvm)
140*9880d681SAndroid Build Coastguard Workerset_target_properties(check PROPERTIES FOLDER "Tests")
141