Add parsing for attributes and attibutes on operations. Add IR representation
for attributes on operations. Split Operation out from OperationInst so it
can be shared with OperationStmt one day.
PiperOrigin-RevId: 203325366
diff --git a/test/IR/parser-affine-map-negative.mlir b/test/IR/parser-affine-map-negative.mlir
index b0a7bec..25b81e8 100644
--- a/test/IR/parser-affine-map-negative.mlir
+++ b/test/IR/parser-affine-map-negative.mlir
@@ -54,3 +54,10 @@
; #hello_world22 = (i, j) -> (i, 3*d0 + j)
; TODO(bondhugula): Add more tests; coverage of error messages emitted not complete
+
+
+; -----
+
+#ABC = (i,j) -> (i+j)
+#ABC = (i,j) -> (i+j) // expected-error {{redefinition of affine map id 'ABC'}}
+
diff --git a/test/IR/parser-errors.mlir b/test/IR/parser-errors.mlir
index 684c5a9..897da80 100644
--- a/test/IR/parser-errors.mlir
+++ b/test/IR/parser-errors.mlir
@@ -91,3 +91,6 @@
mlfunc @non_statement() {
asd ; expected-error {{expected statement}}
}
+
+; -----
+
diff --git a/test/IR/parser.mlir b/test/IR/parser.mlir
index a9d044b..ce0a4da 100644
--- a/test/IR/parser.mlir
+++ b/test/IR/parser.mlir
@@ -78,3 +78,20 @@
} ; CHECK }
return ; CHECK return
} ; CHECK }
+
+; CHECK-LABEL: cfgfunc @attributes() {
+cfgfunc @attributes() {
+bb42: ; CHECK: bb0:
+
+ ; CHECK: "foo"()
+ "foo"(){}
+
+ ; CHECK: "foo"(){a: 1, b: -423, c: [true, false]}
+ "foo"(){a: 1, b: -423, c: [true, false] }
+
+ ; CHECK: "foo"(){if: "foo", cfgfunc: [], i123: 7}
+ "foo"(){if: "foo", cfgfunc: [], i123: 7}
+
+
+ return
+}