1 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s
2 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR2 %s 2>&1 | FileCheck --check-prefix=ERROR2 %s
3 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR3 %s 2>&1 | FileCheck --check-prefix=ERROR3 %s
4 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR4 %s 2>&1 | FileCheck --check-prefix=ERROR4 %s
5 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR5 %s 2>&1 | FileCheck --check-prefix=ERROR5 %s
6 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR6 %s 2>&1 | FileCheck --check-prefix=ERROR6 %s
7 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR7 %s 2>&1 | FileCheck --check-prefix=ERROR7 %s
8 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR8 %s 2>&1 | FileCheck --check-prefix=ERROR8 %s
9 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR9 %s 2>&1 | FileCheck --check-prefix=ERROR9 %s
10 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR10 %s 2>&1 | FileCheck --check-prefix=ERROR10 %s
11 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR11 %s 2>&1 | FileCheck --check-prefix=ERROR11 %s
13 include "mlir/IR/OpBase.td"
15 def Test_Dialect : Dialect {
16 let name = "test_dialect";
20 // ERROR1: error: expected 'ins'
21 def OpInsMissing : Op<Test_Dialect, "ins_missing"> {
29 // ERROR2: error: expected an argument with default value after other arguments with default values
30 def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> {
32 OpBuilder<(ins CArg<"int", "42">, "int")>
38 // ERROR3: error: expected an argument with default value after other arguments with default values
39 def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> {
41 OpBuilder<(ins CArg<"int", "42">, CArg<"int">)>
47 // ERROR4: error: op has a conflict with two operands having the same name 'tensor'
48 def OpWithDuplicatedArgNames : Op<Test_Dialect, "default_value"> {
49 let arguments = (ins AnyTensor:$tensor, AnyTensor:$tensor);
54 // ERROR5: error: op has a conflict with two results having the same name 'tensor'
55 def OpWithDuplicatedResultNames : Op<Test_Dialect, "default_value"> {
56 let results = (outs AnyTensor:$tensor, AnyTensor:$tensor);
61 // ERROR6: error: op has a conflict with operands and results both having an entry with the name 'tensor'
62 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
63 let arguments = (ins AnyTensor:$tensor);
64 let results = (outs AnyTensor:$tensor);
69 // ERROR7: error: op has a conflict with operands and regions both having an entry with the name 'tensor'
70 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
71 let arguments = (ins AnyTensor:$tensor);
72 let regions = (region AnyRegion:$tensor);
77 // ERROR8: error: op has a conflict with results and regions both having an entry with the name 'tensor'
78 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
79 let results = (outs AnyTensor:$tensor);
80 let regions = (region AnyRegion:$tensor);
85 // ERROR9: error: op has a conflict with operands and successors both having an entry with the name 'target'
86 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
87 let successors = (successor AnySuccessor:$target);
88 let arguments = (ins AnyTensor:$target);
93 // ERROR10: error: op has a conflict with results and successors both having an entry with the name 'target'
94 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
95 let successors = (successor AnySuccessor:$target);
96 let results = (outs AnyTensor:$target);
101 // ERROR11: error: op has a conflict with regions and successors both having an entry with the name 'target'
102 def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
103 let successors = (successor AnySuccessor:$target);
104 let regions = (region AnyRegion:$target);