1 ; RUN: opt %loadPolly \
2 ; RUN: -polly-codegen -S < %s | FileCheck %s
4 ; This test cases used to crash the scalar code generation. Check that we
5 ; can generate code for it.
8 @endposition = external global i32, align 4
9 @Bit = external global [0 x i32], align 4
10 @Init = external global [0 x i32], align 4
12 define void @maskgen() {
16 for.body: ; preds = %for.body, %entry
17 br i1 undef, label %for.end.310, label %for.body
19 for.end.310: ; preds = %for.body
20 store i32 undef, ptr @endposition, align 4
21 %sub325 = sub i32 33, 0
22 %0 = load i32, ptr @Init, align 4
23 br i1 false, label %for.cond.347.preheader, label %for.body.328.lr.ph
25 for.body.328.lr.ph: ; preds = %for.end.310
27 br label %for.body.328
29 for.body.328: ; preds = %for.body.328, %for.body.328.lr.ph
30 %indvars.iv546 = phi i64 [ %indvars.iv.next547, %for.body.328 ], [ 1, %for.body.328.lr.ph ]
31 %2 = phi i32 [ %or331, %for.body.328 ], [ %0, %for.body.328.lr.ph ]
32 %arrayidx330 = getelementptr inbounds [0 x i32], ptr @Bit, i64 0, i64 %indvars.iv546
33 %3 = load i32, ptr %arrayidx330, align 4
34 %or331 = or i32 %3, %2
35 %indvars.iv.next547 = add nuw nsw i64 %indvars.iv546, 1
36 %lftr.wideiv = trunc i64 %indvars.iv.next547 to i32
37 %exitcond14 = icmp eq i32 %lftr.wideiv, %1
38 br i1 %exitcond14, label %for.cond.347.preheader, label %for.body.328
40 for.cond.347.preheader: ; preds = %for.cond.347.preheader, %for.body.328, %for.end.310
41 br i1 undef, label %if.end.471, label %for.cond.347.preheader
43 if.end.471: ; preds = %for.cond.347.preheader