llvm-project
54 строки · 1.5 Кб
1// RUN: mlir-tblgen -I %S/../../include %s 2>&1 | FileCheck %s --implicit-check-not warning:
2
3include "mlir/IR/OpBase.td"
4
5def Test_Dialect : Dialect {
6let name = "test_dialect";
7}
8
9def OpTraitA : NativeOpTrait<"OpTraitA">, Deprecated<"use `bar` instead">;
10
11// CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
12def A_AsField {
13NativeOpTrait value = OpTraitA;
14}
15
16// CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
17def B_InList {
18list<NativeOpTrait> value = [OpTraitA];
19}
20
21// CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
22def C_InListList {
23list<list<NativeOpTrait>> value = [[OpTraitA]];
24}
25
26class Base;
27
28// CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
29def D_InDagAsOperator {
30dag value = (OpTraitA $test);
31}
32
33// CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
34def E_InDagAsArg : Base {
35dag value = (ins OpTraitA:$test);
36}
37
38class ThingTakingList<list<NativeOpTrait> l> {
39list<NativeOpTrait> i = l; // avoid unused variable warning.
40}
41
42// CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
43def F_AsFieldWithinAnonymousDef {
44ThingTakingList value = ThingTakingList<[OpTraitA]>;
45}
46
47// CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
48def G_InDagAsAnonymousDefOperator {
49dag value = (ThingTakingList<[OpTraitA]> $test);
50}
51
52def H_ButNotTransitivelyInNonAnonymousDef {
53Base value = E_InDagAsArg;
54}
55