Skip to content

Commit 515376b

Browse files
committed
Add invalid cases to test VectorType verify
1 parent c1ef82d commit 515376b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: cir-opt %s -verify-diagnostics -split-input-file
2+
3+
!s32i = !cir.int<s, 32>
4+
5+
module {
6+
7+
// expected-error @below {{the number of vector elements must be non-zero}}
8+
cir.global external @vec_a = #cir.zero : !cir.vector<0 x !s32i>
9+
10+
}

clang/test/CIR/IR/invalid-vector.cir

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: cir-opt %s -verify-diagnostics -split-input-file
2+
3+
!s32i = !cir.int<s, 32>
4+
5+
module {
6+
7+
// expected-error @below {{expected LLVM-compatible fixed-vector type}}
8+
cir.global external @vec_b = #cir.zero : !cir.vector<4 x !cir.array<!s32i x 10>>
9+
10+
}

0 commit comments

Comments
 (0)