Skip to content

Commit 4ea2a33

Browse files
committed
Add missing tests for vector.{load,store}
1 parent af3aba3 commit 4ea2a33

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

mlir/test/Dialect/Vector/invalid.mlir

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,15 +1952,22 @@ func.func @vector_load(%src : memref<?xi8>) {
19521952

19531953
// -----
19541954

1955-
func.func @invalid_load_alignment(%memref: memref<4xi32>) {
1956-
%c0 = arith.constant 0 : index
1955+
func.func @invalid_load_alignment(%memref: memref<4xi32>, %c0: index) {
19571956
// expected-error @below {{'vector.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}}
19581957
%val = vector.load %memref[%c0] { alignment = -1 } : memref<4xi32>, vector<4xi32>
19591958
return
19601959
}
19611960

19621961
// -----
19631962

1963+
func.func @invalid_load_alignment(%memref: memref<4xi32>, %c0: index) {
1964+
// expected-error @below {{'vector.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}}
1965+
%val = vector.load %memref[%c0] { alignment = 3 } : memref<4xi32>, vector<4xi32>
1966+
return
1967+
}
1968+
1969+
// -----
1970+
19641971
//===----------------------------------------------------------------------===//
19651972
// vector.store
19661973
//===----------------------------------------------------------------------===//
@@ -1974,8 +1981,15 @@ func.func @vector_store(%dest : memref<?xi8>, %vec : vector<16x16xi8>) {
19741981

19751982
// -----
19761983

1977-
func.func @invalid_store_alignment(%memref: memref<4xi32>, %val: vector<4xi32>) {
1978-
%c0 = arith.constant 0 : index
1984+
func.func @invalid_store_alignment(%memref: memref<4xi32>, %val: vector<4xi32>, %c0: index) {
1985+
// expected-error @below {{'vector.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}}
1986+
vector.store %val, %memref[%c0] { alignment = -1 } : memref<4xi32>, vector<4xi32>
1987+
return
1988+
}
1989+
1990+
// -----
1991+
1992+
func.func @invalid_store_alignment(%memref: memref<4xi32>, %val: vector<4xi32>, %c0: index) {
19791993
// expected-error @below {{'vector.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}}
19801994
vector.store %val, %memref[%c0] { alignment = 3 } : memref<4xi32>, vector<4xi32>
19811995
return

0 commit comments

Comments
 (0)