summaryrefslogtreecommitdiff
path: root/mlir/test/Dialect/MemRef/invalid.mlir
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/test/Dialect/MemRef/invalid.mlir')
-rw-r--r--mlir/test/Dialect/MemRef/invalid.mlir18
1 files changed, 18 insertions, 0 deletions
diff --git a/mlir/test/Dialect/MemRef/invalid.mlir b/mlir/test/Dialect/MemRef/invalid.mlir
index 704cdaf838f4..fa803efa1d91 100644
--- a/mlir/test/Dialect/MemRef/invalid.mlir
+++ b/mlir/test/Dialect/MemRef/invalid.mlir
@@ -962,6 +962,24 @@ func.func @test_store_zero_results2(%x: i32, %p: memref<i32>) {
// -----
+func.func @invalid_load_alignment(%memref: memref<4xi32>) {
+ %c0 = arith.constant 0 : index
+ // expected-error @below {{'memref.load' op attribute 'alignment' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive and whose value is a power of two > 0}}
+ %val = memref.load %memref[%c0] { alignment = -1 } : memref<4xi32>
+ return
+}
+
+// -----
+
+func.func @invalid_store_alignment(%memref: memref<4xi32>, %val: i32) {
+ %c0 = arith.constant 0 : index
+ // expected-error @below {{'memref.store' op attribute 'alignment' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive and whose value is a power of two > 0}}
+ memref.store %val, %memref[%c0] { alignment = 3 } : memref<4xi32>
+ return
+}
+
+// -----
+
func.func @test_alloc_memref_map_rank_mismatch() {
^bb0:
// expected-error@+1 {{memref layout mismatch between rank and affine map: 2 != 1}}