1 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
4 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'func_15'
7 @g_16 = external global i16 ; <i16*> [#uses=3]
8 @.str = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
10 define void @func_15() nounwind {
12 %0 = load i16, i16* @g_16, align 2 ; <i16> [#uses=1]
13 %1 = icmp sgt i16 %0, 0 ; <i1> [#uses=1]
14 br i1 %1, label %bb2, label %bb.nph
16 bb.nph: ; preds = %entry
17 %g_16.promoted = load i16, i16* @g_16 ; <i16> [#uses=1]
20 bb: ; preds = %bb1, %bb.nph
21 %g_16.tmp.0 = phi i16 [ %g_16.promoted, %bb.nph ], [ %2, %bb1 ] ; <i16> [#uses=1]
22 %2 = add i16 %g_16.tmp.0, -1 ; <i16> [#uses=3]
26 %3 = icmp sgt i16 %2, 0 ; <i1> [#uses=1]
27 br i1 %3, label %bb1.bb2_crit_edge, label %bb
29 bb1.bb2_crit_edge: ; preds = %bb1
30 store i16 %2, i16* @g_16
33 bb2: ; preds = %bb1.bb2_crit_edge, %entry
36 return: ; preds = %bb2
40 declare i32 @main() nounwind
42 declare i32 @printf(i8*, ...) nounwind