annotate mlir/test/mlir-tblgen/op-error.td @ 243:a916df8444bf

add tag
author matac
date Fri, 11 Aug 2023 15:57:02 +0900
parents c4bab56944e8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR2 %s 2>&1 | FileCheck --check-prefix=ERROR2 %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR3 %s 2>&1 | FileCheck --check-prefix=ERROR3 %s
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
4 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR4 %s 2>&1 | FileCheck --check-prefix=ERROR4 %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
5 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR5 %s 2>&1 | FileCheck --check-prefix=ERROR5 %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
6 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR6 %s 2>&1 | FileCheck --check-prefix=ERROR6 %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
7 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR7 %s 2>&1 | FileCheck --check-prefix=ERROR7 %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
8 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR8 %s 2>&1 | FileCheck --check-prefix=ERROR8 %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
9 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR9 %s 2>&1 | FileCheck --check-prefix=ERROR9 %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
10 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR10 %s 2>&1 | FileCheck --check-prefix=ERROR10 %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
11 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR11 %s 2>&1 | FileCheck --check-prefix=ERROR11 %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
12 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR12 %s 2>&1 | FileCheck --check-prefix=ERROR12 %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
13 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR13 %s 2>&1 | FileCheck --check-prefix=ERROR13 %s
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 include "mlir/IR/OpBase.td"
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 def Test_Dialect : Dialect {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 let name = "test_dialect";
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 }
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 #ifdef ERROR1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 // ERROR1: error: expected 'ins'
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 def OpInsMissing : Op<Test_Dialect, "ins_missing"> {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 let builders = [
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 OpBuilder<(outs)>
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 ];
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 }
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 #endif
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 #ifdef ERROR2
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 // ERROR2: error: expected an argument with default value after other arguments with default values
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 let builders = [
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 OpBuilder<(ins CArg<"int", "42">, "int")>
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 ];
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 }
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 #endif
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 #ifdef ERROR3
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 // ERROR3: error: expected an argument with default value after other arguments with default values
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 let builders = [
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 OpBuilder<(ins CArg<"int", "42">, CArg<"int">)>
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 ];
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 }
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 #endif
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
47
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
48 #ifdef ERROR4
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
49 // ERROR4: error: op has a conflict with two operands having the same name 'tensor'
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
50 def OpWithDuplicatedArgNames : Op<Test_Dialect, "default_value"> {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
51 let arguments = (ins AnyTensor:$tensor, AnyTensor:$tensor);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
52 }
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
53 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
54
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
55 #ifdef ERROR5
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
56 // ERROR5: error: op has a conflict with two results having the same name 'tensor'
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
57 def OpWithDuplicatedResultNames : Op<Test_Dialect, "default_value"> {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
58 let results = (outs AnyTensor:$tensor, AnyTensor:$tensor);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
59 }
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
60 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
61
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
62 #ifdef ERROR6
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
63 // ERROR6: error: op has a conflict with operands and results both having an entry with the name 'tensor'
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
64 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
65 let arguments = (ins AnyTensor:$tensor);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
66 let results = (outs AnyTensor:$tensor);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
67 }
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
68 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
69
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
70 #ifdef ERROR7
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
71 // ERROR7: error: op has a conflict with operands and regions both having an entry with the name 'tensor'
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
72 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
73 let arguments = (ins AnyTensor:$tensor);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
74 let regions = (region AnyRegion:$tensor);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
75 }
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
76 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
77
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
78 #ifdef ERROR8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
79 // ERROR8: error: op has a conflict with results and regions both having an entry with the name 'tensor'
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
80 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
81 let results = (outs AnyTensor:$tensor);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
82 let regions = (region AnyRegion:$tensor);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
83 }
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
84 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
85
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
86 #ifdef ERROR9
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
87 // ERROR9: error: op has a conflict with operands and successors both having an entry with the name 'target'
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
88 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
89 let successors = (successor AnySuccessor:$target);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
90 let arguments = (ins AnyTensor:$target);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
91 }
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
92 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
93
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
94 #ifdef ERROR10
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
95 // ERROR10: error: op has a conflict with results and successors both having an entry with the name 'target'
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
96 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
97 let successors = (successor AnySuccessor:$target);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
98 let results = (outs AnyTensor:$target);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
99 }
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
100 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
101
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
102 #ifdef ERROR11
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
103 // ERROR11: error: op has a conflict with regions and successors both having an entry with the name 'target'
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
104 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
105 let successors = (successor AnySuccessor:$target);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
106 let regions = (region AnyRegion:$target);
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
107 }
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
108 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
109
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
110 #ifdef ERROR12
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
111 def OpTraitA : NativeOpTrait<"OpTraitA"> {}
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
112 def OpTraitB : NativeOpTrait<"OpTraitB", [OpTraitA]> {}
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
113
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
114 // ERROR12: error: OpTraitB requires OpTraitA to precede it in traits list
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
115 def OpTraitWithoutDependentTrait : Op<Test_Dialect, "default_value", [OpTraitB]> {}
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
116 #endif
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
117
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
118 #ifdef ERROR13
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
119 def OpTraitA : NativeOpTrait<"OpTraitA"> {}
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
120 def OpInterfaceB : OpInterface<"OpInterfaceB"> {
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
121 let dependentTraits = [OpTraitA];
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
122 }
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
123
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
124 // ERROR13: error: OpInterfaceB::Trait requires OpTraitA to precede it in traits list
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
125 def OpInterfaceWithoutDependentTrait : Op<Test_Dialect, "default_value", [OpInterfaceB]> {}
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
126 #endif