Debian Codegraph @

llvm-project/utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel

raw
1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5 load("//mlir:tblgen.bzl", "gentbl_cc_library")
6
7 package(
8 default_visibility = ["//visibility:public"],
9 features = ["layering_check"],
10 )
11
12 licenses(["notice"])
13
14 cc_test(
15 name = "ir_tests",
16 size = "small",
17 srcs = glob([
18 "IR/*.cpp",
19 "IR/*.h",
20 ]),
21 deps = [
22 "//llvm:Support",
23 "//mlir:IR",
24 "//mlir/test:TestDialect",
25 "//third-party/unittest:gmock",
26 "//third-party/unittest:gtest",
27 "//third-party/unittest:gtest_main",
28 ],
29 )
30
31 cc_test(
32 name = "interface_tests",
33 size = "small",
34 srcs = glob([
35 "Interfaces/*.cpp",
36 "Interfaces/*.h",
37 ]),
38 deps = [
39 "//llvm:Support",
40 "//llvm:TestingSupport",
41 "//mlir:ArithDialect",
42 "//mlir:ControlFlowInterfaces",
43 "//mlir:DLTIDialect",
44 "//mlir:DataLayoutInterfaces",
45 "//mlir:FuncDialect",
46 "//mlir:IR",
47 "//mlir:InferIntRangeInterface",
48 "//mlir:InferTypeOpInterface",
49 "//mlir:Parser",
50 "//third-party/unittest:gtest",
51 "//third-party/unittest:gtest_main",
52 ],
53 )
54
55 cc_test(
56 name = "support_tests",
57 size = "small",
58 srcs = glob([
59 "Support/*.cpp",
60 "Support/*.h",
61 ]),
62 deps = [
63 "//llvm:Support",
64 "//llvm:TestingSupport",
65 "//mlir:Support",
66 "//third-party/unittest:gmock",
67 "//third-party/unittest:gtest_main",
68 ],
69 )
70
71 cc_test(
72 name = "pass_tests",
73 size = "small",
74 srcs = glob([
75 "Pass/*.cpp",
76 "Pass/*.h",
77 ]),
78 deps = [
79 "//llvm:Support",
80 "//llvm:TestingSupport",
81 "//mlir:Analysis",
82 "//mlir:FuncDialect",
83 "//mlir:IR",
84 "//mlir:Pass",
85 "//third-party/unittest:gtest",
86 "//third-party/unittest:gtest_main",
87 ],
88 )
89
90 cc_test(
91 name = "rewrite_tests",
92 size = "small",
93 srcs = glob([
94 "Rewrite/*.cpp",
95 "Rewrite/*.h",
96 ]),
97 deps = [
98 "//mlir:IR",
99 "//mlir:Rewrite",
100 "//third-party/unittest:gtest",
101 "//third-party/unittest:gtest_main",
102 ],
103 )
104
105 cc_test(
106 name = "dialect_tests",
107 size = "small",
108 srcs = glob([
109 "Dialect/*.cpp",
110 "Dialect/*.h",
111 ]),
112 deps = [
113 "//llvm:Support",
114 "//mlir:Dialect",
115 "//third-party/unittest:gmock",
116 "//third-party/unittest:gtest_main",
117 ],
118 )
119
120 cc_test(
121 name = "memref_tests",
122 size = "small",
123 srcs = glob([
124 "Dialect/MemRef/*.cpp",
125 "Dialect/MemRef/*.h",
126 ]),
127 deps = [
128 "//llvm:TestingSupport",
129 "//mlir:IR",
130 "//mlir:MemRefDialect",
131 "//third-party/unittest:gtest",
132 "//third-party/unittest:gtest_main",
133 ],
134 )
135
136 cc_test(
137 name = "quantops_tests",
138 size = "small",
139 srcs = glob([
140 "Dialect/Quant/*.cpp",
141 "Dialect/Quant/*.h",
142 ]),
143 deps = [
144 "//llvm:TestingSupport",
145 "//mlir:QuantOps",
146 "//mlir:Transforms",
147 "//third-party/unittest:gtest_main",
148 ],
149 )
150
151 cc_test(
152 name = "scf_tests",
153 size = "small",
154 srcs = glob([
155 "Dialect/SCF/*.cpp",
156 "Dialect/SCF/*.h",
157 ]),
158 deps = [
159 "//mlir:FuncDialect",
160 "//mlir:Parser",
161 "//mlir:SCFDialect",
162 "//third-party/unittest:gtest_main",
163 ],
164 )
165
166 cc_test(
167 name = "sparse_tensor_tests",
168 size = "small",
169 srcs = glob([
170 "Dialect/SparseTensor/*.cpp",
171 "Dialect/SparseTensor/*.h",
172 ]),
173 deps = [
174 "//llvm:Support",
175 "//llvm:TestingSupport",
176 "//mlir:SparseTensorUtils",
177 "//third-party/unittest:gmock",
178 "//third-party/unittest:gtest",
179 "//third-party/unittest:gtest_main",
180 ],
181 )
182
183 cc_test(
184 name = "spirv_tests",
185 size = "small",
186 srcs = glob([
187 "Dialect/SPIRV/*.cpp",
188 "Dialect/SPIRV/*.h",
189 ]),
190 deps = [
191 "//llvm:Support",
192 "//llvm:TestingSupport",
193 "//mlir:IR",
194 "//mlir:SPIRVBinaryUtils",
195 "//mlir:SPIRVDeserialization",
196 "//mlir:SPIRVDialect",
197 "//mlir:SPIRVSerialization",
198 "//third-party/unittest:gmock",
199 "//third-party/unittest:gtest_main",
200 ],
201 )
202
203 cc_test(
204 name = "transform_dialect_tests",
205 size = "small",
206 srcs = glob([
207 "Dialect/Transform/*.cpp",
208 "Dialect/Transform/*.h",
209 ]),
210 deps = [
211 "//llvm:TestingSupport",
212 "//mlir:FuncDialect",
213 "//mlir:IR",
214 "//mlir:TransformDialect",
215 "//third-party/unittest:gtest",
216 "//third-party/unittest:gtest_main",
217 ],
218 )
219
220 cc_test(
221 name = "dialect_utils_tests",
222 size = "small",
223 srcs = glob([
224 "Dialect/Utils/*.cpp",
225 "Dialect/Utils/*.h",
226 ]),
227 deps = [
228 "//llvm:TestingSupport",
229 "//mlir:DialectUtils",
230 "//mlir:IR",
231 "//third-party/unittest:gmock",
232 "//third-party/unittest:gtest",
233 "//third-party/unittest:gtest_main",
234 ],
235 )
236
237 gentbl_cc_library(
238 name = "EnumsIncGen",
239 tbl_outs = [
240 (
241 ["-gen-enum-decls"],
242 "TableGen/EnumsGenTest.h.inc",
243 ),
244 (
245 ["-gen-enum-defs"],
246 "TableGen/EnumsGenTest.cpp.inc",
247 ),
248 ],
249 tblgen = "//mlir:mlir-tblgen",
250 td_file = "TableGen/enums.td",
251 deps = [
252 "//mlir:OpBaseTdFiles",
253 ],
254 )
255
256 gentbl_cc_library(
257 name = "PassIncGen",
258 tbl_outs = [
259 (
260 ["-gen-pass-decls"],
261 "TableGen/PassGenTest.h.inc",
262 ),
263 ],
264 tblgen = "//mlir:mlir-tblgen",
265 td_file = "TableGen/passes.td",
266 deps = [
267 "//mlir:PassBaseTdFiles",
268 "//mlir:RewritePassBaseTdFiles",
269 ],
270 )
271
272 cc_test(
273 name = "tablegen_tests",
274 size = "small",
275 srcs = glob([
276 "TableGen/*.cpp",
277 "TableGen/*.h",
278 ]) + [
279 "TableGen/EnumsGenTest.cpp.inc",
280 "TableGen/EnumsGenTest.h.inc",
281 ],
282 includes = ["TableGen/"],
283 deps = [
284 ":EnumsIncGen",
285 ":PassIncGen",
286 "//llvm:Support",
287 "//llvm:TestingSupport",
288 "//mlir:IR",
289 "//mlir:Pass",
290 "//mlir:Support",
291 "//mlir:TableGen",
292 "//mlir/test:TestDialect",
293 "//third-party/unittest:gmock",
294 "//third-party/unittest:gtest_main",
295 ],
296 )
297
298 cc_test(
299 name = "transforms_test",
300 size = "small",
301 srcs = glob([
302 "Transforms/*.cpp",
303 "Transforms/*.h",
304 ]),
305 deps = [
306 "//mlir:AffineAnalysis",
307 "//mlir:IR",
308 "//mlir:Parser",
309 "//mlir:Pass",
310 "//mlir:TransformUtils",
311 "//mlir:Transforms",
312 "//third-party/unittest:gtest",
313 "//third-party/unittest:gtest_main",
314 ],
315 )
316
317 cc_test(
318 name = "analysis_tests",
319 size = "small",
320 srcs = glob([
321 "Analysis/*.cpp",
322 "Analysis/*.h",
323 "Analysis/*/*.cpp",
324 "Analysis/*/*.h",
325 ]),
326 deps = [
327 "//llvm:TestingSupport",
328 "//mlir:AffineAnalysis",
329 "//mlir:Analysis",
330 "//mlir:AsmParser",
331 "//mlir:IR",
332 "//mlir:Parser",
333 "//mlir:Support",
334 "//third-party/unittest:gmock",
335 "//third-party/unittest:gtest",
336 "//third-party/unittest:gtest_main",
337 ],
338 )
339
340 cc_test(
341 name = "conversion_tests",
342 size = "small",
343 srcs = glob([
344 "Conversion/*.cpp",
345 "Conversion/*.h",
346 "Conversion/*/*.cpp",
347 "Conversion/*/*.h",
348 ]),
349 deps = [
350 "//mlir:ArithDialect",
351 "//mlir:IR",
352 "//mlir:PDLToPDLInterp",
353 "//third-party/unittest:gtest",
354 "//third-party/unittest:gtest_main",
355 ],
356 )
357
358 cc_test(
359 name = "execution_engine_tests",
360 size = "small",
361 srcs = glob([
362 "ExecutionEngine/*.cpp",
363 ]),
364 tags = [
365 # MSAN does not work with JIT.
366 "nomsan",
367 ],
368 deps = [
369 "//llvm:Support",
370 "//llvm:TestingSupport",
371 "//mlir:AllPassesAndDialects",
372 "//mlir:Analysis",
373 "//mlir:ArithToLLVM",
374 "//mlir:ExecutionEngine",
375 "//mlir:FuncDialect",
376 "//mlir:FuncToLLVM",
377 "//mlir:IR",
378 "//mlir:LLVMToLLVMIRTranslation",
379 "//mlir:LinalgToLLVM",
380 "//mlir:LinalgTransforms",
381 "//mlir:MemRefToLLVM",
382 "//mlir:Parser",
383 "//mlir:Pass",
384 "//mlir:ReconcileUnrealizedCasts",
385 "//mlir:ToLLVMIRTranslation",
386 "//mlir:VectorToLLVM",
387 "//mlir:VectorToSCF",
388 "//mlir:mlir_c_runner_utils",
389 "//mlir:mlir_runner_utils",
390 "//third-party/unittest:gmock",
391 "//third-party/unittest:gtest_main",
392 ],
393 )