[RS4GC] Fix crash in the case that a live variable has a constant base.
[oota-llvm.git] / test / Transforms / JumpThreading / degenerate-phi.ll
1 ; RUN: opt -jump-threading -disable-output < %s
2 ; PR9112
3
4 ; This is actually a test for value tracking. Jump threading produces
5 ; "%phi = phi i16" when it removes all edges leading to %unreachable.
6 ; The .ll parser won't let us write that directly since it's invalid code.
7
8 define void @func() nounwind {
9 entry:
10   br label %bb
11
12 bb:
13   br label %bb
14
15 unreachable:
16   %phi = phi i16 [ %add, %unreachable ], [ 0, %next ]
17   %add = add i16 0, %phi
18   %cmp = icmp slt i16 %phi, 0
19   br i1 %cmp, label %unreachable, label %next
20
21 next:
22   br label %unreachable
23 }
24