2 ; RUN: opt < %s -loop-reduce -S | FileCheck %s
6 declare ptr @bar(ptr,ptr,ptr,ptr)
8 define void @f(ptr %a,ptr %b,ptr %c,ptr %d,ptr %e,ptr %f,ptr %g) nounwind uwtable {
10 br label %b_throw.preheader
12 D_BREAK_LBL: ; preds = %indirectgoto
14 br label %indirectgoto
16 H_CONST_LBL: ; preds = %indirectgoto
20 H_MPZ_LBL: ; preds = %indirectgoto
21 %boo3 = call i1 @foo()
22 br i1 %boo3, label %body_failed, label %while.cond.i
24 while.cond.i: ; preds = %while.body.i15795, %if.then.i15791
25 %phi = phi i64 [ %tmp20916, %while.body.i15795 ], [ 0, %H_MPZ_LBL ]
26 %tmp20916 = add i64 %phi, 1
27 %incdec.ptr.i15793 = getelementptr i64, ptr %pc.0.lcssa.i1610719352, i64 %tmp20916
28 %boo2 = call i1 @foo()
29 br i1 %boo2, label %indirectgoto, label %while.body.i15795
31 while.body.i15795: ; preds = %while.cond.i
32 %tmp20.i = load i64, ptr %incdec.ptr.i15793, align 8
33 %boo1 = call i1 @foo()
34 br i1 %boo1, label %while.cond.i, label %body_failed
36 b_throw.preheader: ; preds = %body_failed, %entry
38 br label %indirectgoto
41 %pc.0.lcssa.i1610719364 = phi ptr [ %pc.0.lcssa.i1610719352, %indirectgoto ], [ %pc.0.lcssa.i1610719352, %H_MPZ_LBL ], [ %b, %H_CONST_LBL ], [ %pc.0.lcssa.i1610719352, %while.body.i15795 ]
43 br label %b_throw.preheader
46 %pc.0.lcssa.i1610719352 = phi ptr [ %pc.0.lcssa.i1610719352, %D_BREAK_LBL ], [ %a, %b_throw.preheader ], [ %d, %while.cond.i ]
47 %p = call ptr @bar(ptr blockaddress(@f, %D_BREAK_LBL), ptr blockaddress(@f, %H_CONST_LBL), ptr blockaddress(@f, %H_MPZ_LBL), ptr blockaddress(@f, %body_failed) )
48 indirectbr ptr %p, [label %D_BREAK_LBL, label %H_CONST_LBL, label %H_MPZ_LBL, label %body_failed]
51 ; CHECK: %p = call ptr @bar(ptr blockaddress(@f, %D_BREAK_LBL), ptr blockaddress(@f, %H_CONST_LBL), ptr blockaddress(@f, %H_MPZ_LBL), ptr blockaddress(@f, %body_failed))
52 ; CHECK: indirectbr ptr %p, [label %D_BREAK_LBL, label %H_CONST_LBL, label %H_MPZ_LBL, label %body_failed]