Skip to content

Commit 77916a6

Browse files
committed
Add test for the verifier
1 parent 8e662a8 commit 77916a6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: cir-opt %s -verify-diagnostics -split-input-file
2+
3+
!s32i = !cir.int<s, 32>
4+
!s64i = !cir.int<s, 64>
5+
6+
module {
7+
cir.func @foo() {
8+
%1 = cir.const #cir.int<1> : !s32i
9+
%2 = cir.const #cir.int<2> : !s32i
10+
%3 = cir.const #cir.int<3> : !s32i
11+
%4 = cir.const #cir.int<4> : !s32i
12+
%vec = cir.vec.create(%1, %2, %3, %4 : !s32i, !s32i, !s32i, !s32i) : !cir.vector<4 x !s32i>
13+
%indices = cir.vec.create(%1, %2 : !s32i, !s32i) : !cir.vector<2 x !s32i>
14+
15+
// expected-error @below {{the number of elements in '!cir.vector<4 x !cir.int<s, 32>>' and '!cir.vector<2 x !cir.int<s, 32>>' don't match}}
16+
%new_vec = cir.vec.shuffle.dynamic %vec : !cir.vector<4 x !s32i>, %indices : !cir.vector<2 x !s32i>
17+
cir.return
18+
}
19+
}

0 commit comments

Comments
 (0)