1 ; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
2 ; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
5 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'func_15'
8 @g_16 = external global i16 ; <i16*> [#uses=3]
9 @.str = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
11 define void @func_15() nounwind {
13 %0 = load i16, i16* @g_16, align 2 ; <i16> [#uses=1]
14 %1 = icmp sgt i16 %0, 0 ; <i1> [#uses=1]
15 br i1 %1, label %bb2, label %bb.nph
17 bb.nph: ; preds = %entry
18 %g_16.promoted = load i16, i16* @g_16 ; <i16> [#uses=1]
21 bb: ; preds = %bb1, %bb.nph
22 %g_16.tmp.0 = phi i16 [ %g_16.promoted, %bb.nph ], [ %2, %bb1 ] ; <i16> [#uses=1]
23 %2 = add i16 %g_16.tmp.0, -1 ; <i16> [#uses=3]
27 %3 = icmp sgt i16 %2, 0 ; <i1> [#uses=1]
28 br i1 %3, label %bb1.bb2_crit_edge, label %bb
30 bb1.bb2_crit_edge: ; preds = %bb1
31 store i16 %2, i16* @g_16
34 bb2: ; preds = %bb1.bb2_crit_edge, %entry
37 return: ; preds = %bb2
41 declare i32 @main() nounwind
43 declare i32 @printf(i8*, ...) nounwind