Skip to content

Commit a5bc84b

Browse files
committed
Add lit test
1 parent 17613e1 commit a5bc84b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; Check that we do not crash (see PR #152700)
2+
; RUN: opt < %s -passes=instcombine
3+
4+
declare noundef i32 @llvm.nvvm.read.ptx.sreg.nctaid.x()
5+
declare i32 @llvm.umin.i32(i32, i32)
6+
define i32 @foo(i1 %c, i32 %arg) {
7+
entry:
8+
%i = call i32 @llvm.nvvm.read.ptx.sreg.nctaid.x()
9+
br i1 %c, label %bb.1, label %bb.2
10+
bb.1:
11+
br label %bb.2
12+
bb.2:
13+
%phi = phi i32 [ %i, %entry ], [ 0, %bb.1 ]
14+
%res = call i32 @llvm.umin.i32(i32 %phi, i32 %arg)
15+
ret i32 %res
16+
}

0 commit comments

Comments
 (0)