1 ; RUN: opt < %s -basicaa -licm -S | FileCheck %s
2 @b = external global i32, align 4
3 @fn3.i = external global i32, align 4
5 declare i32 @g() nounwind
11 for.cond: ; preds = %for.end, %entry
12 ; CHECK-LABEL: for.cond:
13 ; CHECK: store i32 0, i32* @b
14 store i32 0, i32* @b, align 4
15 br i1 true, label %for.body.preheader, label %for.end
17 for.body.preheader: ; preds = %for.cond
20 for.body: ; preds = %for.body, %for.body.preheader
21 %g.15 = phi i32 [ undef, %for.body ], [ 0, %for.body.preheader ]
22 %arrayidx2 = getelementptr inbounds i32, i32* @fn3.i, i64 0
23 %0 = load i32, i32* %arrayidx2, align 4
25 br i1 false, label %for.body, label %for.end.loopexit
27 for.end.loopexit: ; preds = %for.body
30 for.end: ; preds = %for.end.loopexit, %for.cond
31 %whatever = phi i32 [ %call, %for.end.loopexit ], [ undef, %for.cond ]
32 br i1 false, label %for.cond, label %if.then
34 if.then: ; preds = %for.end
35 ; CHECK-LABEL: if.then:
36 ; CHECK: phi i32 [ {{.*}}, %for.end ]
37 ; CHECK-NOT: store i32 0, i32* @b