brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.0 KiB · a2eab1f Raw
127 lines · plain
1// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s2// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR2 %s 2>&1 | FileCheck --check-prefix=ERROR2 %s3// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR3 %s 2>&1 | FileCheck --check-prefix=ERROR3 %s4// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR4 %s 2>&1 | FileCheck --check-prefix=ERROR4 %s5// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR5 %s 2>&1 | FileCheck --check-prefix=ERROR5 %s6// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR6 %s 2>&1 | FileCheck --check-prefix=ERROR6 %s7// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR7 %s 2>&1 | FileCheck --check-prefix=ERROR7 %s8// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR8 %s 2>&1 | FileCheck --check-prefix=ERROR8 %s9// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR9 %s 2>&1 | FileCheck --check-prefix=ERROR9 %s10// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR10 %s 2>&1 | FileCheck --check-prefix=ERROR10 %s11// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR11 %s 2>&1 | FileCheck --check-prefix=ERROR11 %s12// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR12 %s 2>&1 | FileCheck --check-prefix=ERROR12 %s13// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR13 %s 2>&1 | FileCheck --check-prefix=ERROR13 %s14 15include "mlir/IR/OpBase.td"16 17def Test_Dialect : Dialect {18  let name = "test_dialect";19}20 21#ifdef ERROR122// ERROR1: error: expected 'ins'23def OpInsMissing : Op<Test_Dialect, "ins_missing"> {24  let builders = [25    OpBuilder<(outs)>26  ];27}28#endif29 30#ifdef ERROR231// ERROR2: error: expected an argument with default value after other arguments with default values32def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> {33  let builders = [34    OpBuilder<(ins CArg<"int", "42">, "int")>35  ];36}37#endif38 39#ifdef ERROR340// ERROR3: error: expected an argument with default value after other arguments with default values41def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> {42  let builders = [43    OpBuilder<(ins CArg<"int", "42">, CArg<"int">)>44  ];45}46#endif47 48#ifdef ERROR449// ERROR4: error: op has a conflict with two operands having the same name 'tensor'50def OpWithDuplicatedArgNames : Op<Test_Dialect, "default_value"> {51  let arguments = (ins AnyTensor:$tensor, AnyTensor:$tensor);52}53#endif54 55#ifdef ERROR556// ERROR5: error: op has a conflict with two results having the same name 'tensor'57def OpWithDuplicatedResultNames : Op<Test_Dialect, "default_value"> {58  let results = (outs AnyTensor:$tensor, AnyTensor:$tensor);59}60#endif61 62#ifdef ERROR663// ERROR6: error: op has a conflict with operands and results both having an entry with the name 'tensor'64def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {65  let arguments = (ins AnyTensor:$tensor);66  let results = (outs AnyTensor:$tensor);67}68#endif69 70#ifdef ERROR771// ERROR7: error: op has a conflict with operands and regions both having an entry with the name 'tensor'72def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {73  let arguments = (ins AnyTensor:$tensor);74  let regions = (region AnyRegion:$tensor);75}76#endif77 78#ifdef ERROR879// ERROR8: error: op has a conflict with results and regions both having an entry with the name 'tensor'80def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {81  let results = (outs AnyTensor:$tensor);82  let regions = (region AnyRegion:$tensor);83}84#endif85 86#ifdef ERROR987// ERROR9: error: op has a conflict with operands and successors both having an entry with the name 'target'88def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {89  let successors = (successor AnySuccessor:$target);90  let arguments = (ins AnyTensor:$target);91}92#endif93 94#ifdef ERROR1095// ERROR10: error: op has a conflict with results and successors both having an entry with the name 'target'96def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {97  let successors = (successor AnySuccessor:$target);98  let results = (outs AnyTensor:$target);99}100#endif101 102#ifdef ERROR11103// ERROR11: error: op has a conflict with regions and successors both having an entry with the name 'target'104def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {105  let successors = (successor AnySuccessor:$target);106  let regions = (region AnyRegion:$target);107}108#endif109 110#ifdef ERROR12111def OpTraitA : NativeOpTrait<"OpTraitA"> {}112def OpTraitB : NativeOpTrait<"OpTraitB", [OpTraitA]> {}113 114// ERROR12: error: OpTraitB requires OpTraitA to precede it in traits list115def OpTraitWithoutDependentTrait : Op<Test_Dialect, "default_value", [OpTraitB]> {}116#endif117 118#ifdef ERROR13119def OpTraitA : NativeOpTrait<"OpTraitA"> {}120def OpInterfaceB : OpInterface<"OpInterfaceB"> {121  let dependentTraits = [OpTraitA];122}123 124// ERROR13: error: OpInterfaceB::Trait requires OpTraitA to precede it in traits list125def OpInterfaceWithoutDependentTrait : Op<Test_Dialect, "default_value", [OpInterfaceB]> {}126#endif127