Debian Codegraph @

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