annotate clang/test/CMakeLists.txt @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children 5f17cb93ff66
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 # Test runner infrastructure for Clang. This configures the Clang test trees
anatofuz
parents:
diff changeset
2 # for use by Lit, and delegates to LLVM's lit test handlers.
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 if (CMAKE_CFG_INTDIR STREQUAL ".")
anatofuz
parents:
diff changeset
5 set(LLVM_BUILD_MODE ".")
anatofuz
parents:
diff changeset
6 else ()
anatofuz
parents:
diff changeset
7 set(LLVM_BUILD_MODE "%(build_mode)s")
anatofuz
parents:
diff changeset
8 endif ()
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 llvm_canonicalize_cmake_booleans(
anatofuz
parents:
diff changeset
13 CLANG_BUILD_EXAMPLES
anatofuz
parents:
diff changeset
14 CLANG_ENABLE_ARCMT
anatofuz
parents:
diff changeset
15 CLANG_ENABLE_STATIC_ANALYZER
anatofuz
parents:
diff changeset
16 CLANG_SPAWN_CC1
anatofuz
parents:
diff changeset
17 ENABLE_BACKTRACES
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
18 LLVM_ENABLE_NEW_PASS_MANAGER
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
19 LLVM_ENABLE_ZLIB
150
anatofuz
parents:
diff changeset
20 LLVM_ENABLE_PER_TARGET_RUNTIME_DIR
anatofuz
parents:
diff changeset
21 LLVM_ENABLE_PLUGINS
anatofuz
parents:
diff changeset
22 LLVM_ENABLE_THREADS)
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 configure_lit_site_cfg(
anatofuz
parents:
diff changeset
25 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
anatofuz
parents:
diff changeset
26 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
anatofuz
parents:
diff changeset
27 MAIN_CONFIG
anatofuz
parents:
diff changeset
28 ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
29 PATHS
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
30 "LLVM_SOURCE_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
31 "LLVM_BINARY_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
32 "LLVM_TOOLS_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
33 "LLVM_LIBS_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
34 "SHLIBDIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
35 "LLVM_LIT_TOOLS_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
36 "CLANG_BINARY_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
37 "CLANG_SOURCE_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
38 "CLANG_TOOLS_DIR"
150
anatofuz
parents:
diff changeset
39 )
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 configure_lit_site_cfg(
anatofuz
parents:
diff changeset
42 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
anatofuz
parents:
diff changeset
43 ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
anatofuz
parents:
diff changeset
44 MAIN_CONFIG
anatofuz
parents:
diff changeset
45 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
46 PATHS
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
47 "LLVM_SOURCE_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
48 "LLVM_BINARY_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
49 "LLVM_TOOLS_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
50 "LLVM_LIBS_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
51 "CLANG_BINARY_DIR"
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
52 "SHLIBDIR"
150
anatofuz
parents:
diff changeset
53 )
anatofuz
parents:
diff changeset
54
anatofuz
parents:
diff changeset
55 option(CLANG_TEST_USE_VG "Run Clang tests under Valgrind" OFF)
anatofuz
parents:
diff changeset
56 if(CLANG_TEST_USE_VG)
anatofuz
parents:
diff changeset
57 set(CLANG_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
anatofuz
parents:
diff changeset
58 endif ()
anatofuz
parents:
diff changeset
59
anatofuz
parents:
diff changeset
60 list(APPEND CLANG_TEST_DEPS
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
61 apinotes-test
150
anatofuz
parents:
diff changeset
62 c-index-test
anatofuz
parents:
diff changeset
63 clang
anatofuz
parents:
diff changeset
64 clang-resource-headers
anatofuz
parents:
diff changeset
65 clang-format
anatofuz
parents:
diff changeset
66 clang-tblgen
anatofuz
parents:
diff changeset
67 clang-offload-bundler
anatofuz
parents:
diff changeset
68 clang-import-test
anatofuz
parents:
diff changeset
69 clang-rename
anatofuz
parents:
diff changeset
70 clang-refactor
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
71 clang-repl
150
anatofuz
parents:
diff changeset
72 clang-diff
anatofuz
parents:
diff changeset
73 clang-scan-deps
anatofuz
parents:
diff changeset
74 diagtool
anatofuz
parents:
diff changeset
75 hmaptool
anatofuz
parents:
diff changeset
76 )
anatofuz
parents:
diff changeset
77
anatofuz
parents:
diff changeset
78 if(CLANG_ENABLE_STATIC_ANALYZER)
anatofuz
parents:
diff changeset
79 list(APPEND CLANG_TEST_DEPS
anatofuz
parents:
diff changeset
80 clang-check
anatofuz
parents:
diff changeset
81 clang-extdef-mapping
anatofuz
parents:
diff changeset
82 )
anatofuz
parents:
diff changeset
83 endif()
anatofuz
parents:
diff changeset
84
anatofuz
parents:
diff changeset
85 if (CLANG_ENABLE_ARCMT)
anatofuz
parents:
diff changeset
86 list(APPEND CLANG_TEST_DEPS
anatofuz
parents:
diff changeset
87 arcmt-test
anatofuz
parents:
diff changeset
88 c-arcmt-test
anatofuz
parents:
diff changeset
89 )
anatofuz
parents:
diff changeset
90 endif ()
anatofuz
parents:
diff changeset
91
anatofuz
parents:
diff changeset
92 if (CLANG_BUILD_EXAMPLES)
anatofuz
parents:
diff changeset
93 list(APPEND CLANG_TEST_DEPS
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
94 Attribute
150
anatofuz
parents:
diff changeset
95 AnnotateFunctions
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
96 CallSuperAttr
150
anatofuz
parents:
diff changeset
97 clang-interpreter
anatofuz
parents:
diff changeset
98 PrintFunctionNames
anatofuz
parents:
diff changeset
99 )
anatofuz
parents:
diff changeset
100 endif ()
anatofuz
parents:
diff changeset
101
anatofuz
parents:
diff changeset
102 set(CLANG_TEST_PARAMS
anatofuz
parents:
diff changeset
103 USE_Z3_SOLVER=0
anatofuz
parents:
diff changeset
104 )
anatofuz
parents:
diff changeset
105
anatofuz
parents:
diff changeset
106 if( NOT CLANG_BUILT_STANDALONE )
anatofuz
parents:
diff changeset
107 list(APPEND CLANG_TEST_DEPS
anatofuz
parents:
diff changeset
108 llvm-config
anatofuz
parents:
diff changeset
109 FileCheck count not
anatofuz
parents:
diff changeset
110 llc
anatofuz
parents:
diff changeset
111 llvm-as
anatofuz
parents:
diff changeset
112 llvm-bcanalyzer
anatofuz
parents:
diff changeset
113 llvm-cat
anatofuz
parents:
diff changeset
114 llvm-cxxfilt
anatofuz
parents:
diff changeset
115 llvm-dis
anatofuz
parents:
diff changeset
116 llvm-dwarfdump
anatofuz
parents:
diff changeset
117 llvm-ifs
anatofuz
parents:
diff changeset
118 llvm-lto2
anatofuz
parents:
diff changeset
119 llvm-modextract
anatofuz
parents:
diff changeset
120 llvm-nm
anatofuz
parents:
diff changeset
121 llvm-objcopy
anatofuz
parents:
diff changeset
122 llvm-objdump
anatofuz
parents:
diff changeset
123 llvm-profdata
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
124 llvm-rc
150
anatofuz
parents:
diff changeset
125 llvm-readelf
anatofuz
parents:
diff changeset
126 llvm-readobj
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
127 llvm-strip
150
anatofuz
parents:
diff changeset
128 llvm-symbolizer
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
129 llvm-windres
150
anatofuz
parents:
diff changeset
130 opt
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
131 split-file
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
132 yaml2obj
150
anatofuz
parents:
diff changeset
133 )
anatofuz
parents:
diff changeset
134
anatofuz
parents:
diff changeset
135 if(TARGET llvm-lto)
anatofuz
parents:
diff changeset
136 list(APPEND CLANG_TEST_DEPS llvm-lto)
anatofuz
parents:
diff changeset
137 endif()
anatofuz
parents:
diff changeset
138 endif()
anatofuz
parents:
diff changeset
139
anatofuz
parents:
diff changeset
140 if (CLANG_ENABLE_STATIC_ANALYZER)
anatofuz
parents:
diff changeset
141 if (LLVM_ENABLE_PLUGINS)
anatofuz
parents:
diff changeset
142 list(APPEND CLANG_TEST_DEPS
anatofuz
parents:
diff changeset
143 SampleAnalyzerPlugin
anatofuz
parents:
diff changeset
144 CheckerDependencyHandlingAnalyzerPlugin
anatofuz
parents:
diff changeset
145 CheckerOptionHandlingAnalyzerPlugin
anatofuz
parents:
diff changeset
146 )
anatofuz
parents:
diff changeset
147 endif()
anatofuz
parents:
diff changeset
148 endif()
anatofuz
parents:
diff changeset
149
anatofuz
parents:
diff changeset
150 # Copy gen_ast_dump_json_test.py to the clang build dir. This allows invoking
anatofuz
parents:
diff changeset
151 # it without having to pass the --clang= argument
anatofuz
parents:
diff changeset
152 configure_file(AST/gen_ast_dump_json_test.py
anatofuz
parents:
diff changeset
153 ${CLANG_BINARY_DIR}/bin/gen_ast_dump_json_test.py COPYONLY)
anatofuz
parents:
diff changeset
154
anatofuz
parents:
diff changeset
155 add_custom_target(clang-test-depends DEPENDS ${CLANG_TEST_DEPS})
anatofuz
parents:
diff changeset
156 set_target_properties(clang-test-depends PROPERTIES FOLDER "Clang tests")
anatofuz
parents:
diff changeset
157
anatofuz
parents:
diff changeset
158 add_lit_testsuite(check-clang "Running the Clang regression tests"
anatofuz
parents:
diff changeset
159 ${CMAKE_CURRENT_BINARY_DIR}
anatofuz
parents:
diff changeset
160 #LIT ${LLVM_LIT}
anatofuz
parents:
diff changeset
161 PARAMS ${CLANG_TEST_PARAMS}
anatofuz
parents:
diff changeset
162 DEPENDS ${CLANG_TEST_DEPS}
anatofuz
parents:
diff changeset
163 ARGS ${CLANG_TEST_EXTRA_ARGS}
anatofuz
parents:
diff changeset
164 )
anatofuz
parents:
diff changeset
165 set_target_properties(check-clang PROPERTIES FOLDER "Clang tests")
anatofuz
parents:
diff changeset
166
anatofuz
parents:
diff changeset
167 add_lit_testsuites(CLANG ${CMAKE_CURRENT_SOURCE_DIR}
anatofuz
parents:
diff changeset
168 PARAMS ${CLANG_TEST_PARAMS}
anatofuz
parents:
diff changeset
169 DEPENDS ${CLANG_TEST_DEPS}
anatofuz
parents:
diff changeset
170 )
anatofuz
parents:
diff changeset
171
anatofuz
parents:
diff changeset
172 # Add a legacy target spelling: clang-test
anatofuz
parents:
diff changeset
173 add_custom_target(clang-test)
anatofuz
parents:
diff changeset
174 add_dependencies(clang-test check-clang)
anatofuz
parents:
diff changeset
175 set_target_properties(clang-test PROPERTIES FOLDER "Clang tests")
anatofuz
parents:
diff changeset
176
anatofuz
parents:
diff changeset
177 # FIXME: This logic can be removed once all buildbots have moved
anatofuz
parents:
diff changeset
178 # debuginfo-test from clang/test to llvm/projects or monorepo.
anatofuz
parents:
diff changeset
179 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/debuginfo-tests)
anatofuz
parents:
diff changeset
180 message(WARNING "Including debuginfo-tests in clang/test is deprecated. Move to llvm/projects or use monorepo.")
anatofuz
parents:
diff changeset
181 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/debuginfo-tests/CMakeLists.txt)
anatofuz
parents:
diff changeset
182 add_subdirectory(debuginfo-tests)
anatofuz
parents:
diff changeset
183 endif()
anatofuz
parents:
diff changeset
184 endif()