1; RUN: opt < %s -loop-reduce | llvm-dis
2; PR3399
3
4@g_53 = external global i32		; <i32*> [#uses=1]
5
6define i32 @foo() nounwind {
7bb5.thread:
8	br label %bb
9
10bb:		; preds = %bb5, %bb5.thread
11	%indvar = phi i32 [ 0, %bb5.thread ], [ %indvar.next, %bb5 ]		; <i32> [#uses=2]
12	br i1 false, label %bb5, label %bb1
13
14bb1:		; preds = %bb
15	%l_2.0.reg2mem.0 = sub i32 0, %indvar		; <i32> [#uses=1]
16	%0 = load volatile i32, i32* @g_53, align 4		; <i32> [#uses=1]
17	%1 = trunc i32 %l_2.0.reg2mem.0 to i16		; <i16> [#uses=1]
18	%2 = trunc i32 %0 to i16		; <i16> [#uses=1]
19	%3 = mul i16 %2, %1		; <i16> [#uses=1]
20	%4 = icmp eq i16 %3, 0		; <i1> [#uses=1]
21	br i1 %4, label %bb7, label %bb2
22
23bb2:		; preds = %bb2, %bb1
24	br label %bb2
25
26bb5:		; preds = %bb
27	%indvar.next = add i32 %indvar, 1		; <i32> [#uses=1]
28	br label %bb
29
30bb7:		; preds = %bb1
31	ret i32 1
32}
33