diff mlir/test/mlir-tblgen/op-error.td @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 79ff65ed7e25
children
line wrap: on
line diff
--- a/mlir/test/mlir-tblgen/op-error.td	Wed Jul 21 10:27:27 2021 +0900
+++ b/mlir/test/mlir-tblgen/op-error.td	Wed Nov 09 17:45:10 2022 +0900
@@ -1,6 +1,16 @@
 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s
 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR2 %s 2>&1 | FileCheck --check-prefix=ERROR2 %s
 // RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR3 %s 2>&1 | FileCheck --check-prefix=ERROR3 %s
+// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR4 %s 2>&1 | FileCheck --check-prefix=ERROR4 %s
+// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR5 %s 2>&1 | FileCheck --check-prefix=ERROR5 %s
+// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR6 %s 2>&1 | FileCheck --check-prefix=ERROR6 %s
+// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR7 %s 2>&1 | FileCheck --check-prefix=ERROR7 %s
+// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR8 %s 2>&1 | FileCheck --check-prefix=ERROR8 %s
+// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR9 %s 2>&1 | FileCheck --check-prefix=ERROR9 %s
+// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR10 %s 2>&1 | FileCheck --check-prefix=ERROR10 %s
+// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR11 %s 2>&1 | FileCheck --check-prefix=ERROR11 %s
+// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR12 %s 2>&1 | FileCheck --check-prefix=ERROR12 %s
+// RUN: not mlir-tblgen -gen-op-decls -I %S/../../include -DERROR13 %s 2>&1 | FileCheck --check-prefix=ERROR13 %s
 
 include "mlir/IR/OpBase.td"
 
@@ -34,3 +44,83 @@
   ];
 }
 #endif
+
+#ifdef ERROR4
+// ERROR4: error: op has a conflict with two operands having the same name 'tensor'
+def OpWithDuplicatedArgNames : Op<Test_Dialect, "default_value"> {
+  let arguments = (ins AnyTensor:$tensor, AnyTensor:$tensor);
+}
+#endif
+
+#ifdef ERROR5
+// ERROR5: error: op has a conflict with two results having the same name 'tensor'
+def OpWithDuplicatedResultNames : Op<Test_Dialect, "default_value"> {
+  let results = (outs AnyTensor:$tensor, AnyTensor:$tensor);
+}
+#endif
+
+#ifdef ERROR6
+// ERROR6: error: op has a conflict with operands and results both having an entry with the name 'tensor'
+def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
+  let arguments = (ins AnyTensor:$tensor);
+  let results = (outs AnyTensor:$tensor);
+}
+#endif
+
+#ifdef ERROR7
+// ERROR7: error: op has a conflict with operands and regions both having an entry with the name 'tensor'
+def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
+  let arguments = (ins AnyTensor:$tensor);
+  let regions = (region AnyRegion:$tensor);
+}
+#endif
+
+#ifdef ERROR8
+// ERROR8: error: op has a conflict with results and regions both having an entry with the name 'tensor'
+def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
+  let results = (outs AnyTensor:$tensor);
+  let regions = (region AnyRegion:$tensor);
+}
+#endif
+
+#ifdef ERROR9
+// ERROR9: error: op has a conflict with operands and successors both having an entry with the name 'target'
+def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
+  let successors = (successor AnySuccessor:$target);
+  let arguments = (ins AnyTensor:$target);
+}
+#endif
+
+#ifdef ERROR10
+// ERROR10: error: op has a conflict with results and successors both having an entry with the name 'target'
+def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
+  let successors = (successor AnySuccessor:$target);
+  let results = (outs AnyTensor:$target);
+}
+#endif
+
+#ifdef ERROR11
+// ERROR11: error: op has a conflict with regions and successors both having an entry with the name 'target'
+def OpWithDuplicatedArgResultNames : Op<Test_Dialect, "default_value"> {
+  let successors = (successor AnySuccessor:$target);
+  let regions = (region AnyRegion:$target);
+}
+#endif
+
+#ifdef ERROR12
+def OpTraitA : NativeOpTrait<"OpTraitA"> {}
+def OpTraitB : NativeOpTrait<"OpTraitB", [OpTraitA]> {}
+
+// ERROR12: error: OpTraitB requires OpTraitA to precede it in traits list
+def OpTraitWithoutDependentTrait : Op<Test_Dialect, "default_value", [OpTraitB]> {}
+#endif
+
+#ifdef ERROR13
+def OpTraitA : NativeOpTrait<"OpTraitA"> {}
+def OpInterfaceB : OpInterface<"OpInterfaceB"> {
+  let dependentTraits = [OpTraitA];
+}
+
+// ERROR13: error: OpInterfaceB::Trait requires OpTraitA to precede it in traits list
+def OpInterfaceWithoutDependentTrait : Op<Test_Dialect, "default_value", [OpInterfaceB]> {}
+#endif