summaryrefslogtreecommitdiffstats
path: root/mlir/test/IR
diff options
context:
space:
mode:
authorMLIR Team <no-reply@google.com>2019-11-20 16:30:14 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-11-20 18:30:15 -0800
commit75379a684f61b92dff752e348ceebcff24a039d9 (patch)
tree23dd7820e7abcad61905ff7ea78a9f77bb3566bb /mlir/test/IR
parentfafb708b9a0bb4adbdcba0cd7a7cdacf55211696 (diff)
downloadbcm5719-llvm-75379a684f61b92dff752e348ceebcff24a039d9.tar.gz
bcm5719-llvm-75379a684f61b92dff752e348ceebcff24a039d9.zip
Correctly parse empty affine maps.
Previously the test case crashes / produces an error. PiperOrigin-RevId: 281630540
Diffstat (limited to 'mlir/test/IR')
-rw-r--r--mlir/test/IR/affine-map.mlir6
-rw-r--r--mlir/test/IR/invalid-affinemap.mlir3
2 files changed, 6 insertions, 3 deletions
diff --git a/mlir/test/IR/affine-map.mlir b/mlir/test/IR/affine-map.mlir
index ab7647b2d76..d867d5113b6 100644
--- a/mlir/test/IR/affine-map.mlir
+++ b/mlir/test/IR/affine-map.mlir
@@ -177,6 +177,9 @@
// CHECK: #map{{[0-9]+}} = (d0)[s0] -> ((-s0) floordiv 4, d0 floordiv -1)
#map54 = (d0)[s0] -> (-s0 floordiv 4, d0 floordiv -1)
+// CHECK: #map{{[0-9]+}} = () -> ()
+#map55 = () -> ()
+
// Single identity maps are removed.
// CHECK: func @f0(memref<2x4xi8, 1>)
func @f0(memref<2x4xi8, #map0, 1>)
@@ -349,3 +352,6 @@ func @f53(memref<1xi8, #map53>)
// CHECK: func @f54(memref<10xi32, #map{{[0-9]+}}>)
func @f54(memref<10xi32, #map54>)
+
+// CHECK: "foo.op"() {map = #map{{[0-9]+}}} : () -> ()
+"foo.op"() {map = #map55} : () -> ()
diff --git a/mlir/test/IR/invalid-affinemap.mlir b/mlir/test/IR/invalid-affinemap.mlir
index a538568f5d1..f13636238e3 100644
--- a/mlir/test/IR/invalid-affinemap.mlir
+++ b/mlir/test/IR/invalid-affinemap.mlir
@@ -44,9 +44,6 @@
#hello_world = (i, j) [i, s0] -> (j) // expected-error {{redefinition of identifier 'i'}}
// -----
-#hello_world = (i, j) [s0, s1] -> () // expected-error {{expected list element}}
-
-// -----
#hello_world = (i, j) [s0, s1] -> (+i, j) // expected-error {{missing left operand of binary op}}
// -----
OpenPOWER on IntegriCloud