1 ; RUN: opt < %s -S -loop-unroll -unroll-runtime | FileCheck %s
2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
3 target triple = "powerpc64-bgq-linux"
5 define void @test1() nounwind {
6 ; Ensure that we don't crash when the trip count == -1.
9 br label %for.cond2.preheader
11 for.cond2.preheader: ; preds = %for.end, %entry
12 br i1 false, label %middle.block, label %vector.ph
14 vector.ph: ; preds = %for.cond2.preheader
17 vector.body: ; preds = %vector.body, %vector.ph
18 br i1 undef, label %middle.block.loopexit, label %vector.body
20 middle.block.loopexit: ; preds = %vector.body
21 br label %middle.block
23 middle.block: ; preds = %middle.block.loopexit, %for.cond2.preheader
24 br i1 true, label %for.end, label %scalar.preheader
26 scalar.preheader: ; preds = %middle.block
29 for.body4: ; preds = %for.body4, %scalar.preheader
30 %indvars.iv = phi i64 [ 16000, %scalar.preheader ], [ %indvars.iv.next, %for.body4 ]
31 %indvars.iv.next = add i64 %indvars.iv, 1
32 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
33 %exitcond = icmp ne i32 %lftr.wideiv, 16000
34 br i1 %exitcond, label %for.body4, label %for.end.loopexit
36 for.end.loopexit: ; preds = %for.body4
39 for.end: ; preds = %for.end.loopexit, %middle.block
40 br i1 undef, label %for.cond2.preheader, label %for.end15
42 for.end15: ; preds = %for.end