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