1; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution 2>&1 | FileCheck %s
2; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 2>&1 | FileCheck %s
3; PR2070
4
5; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'a'
6; CHECK-NOT: smax
7
8define i32 @a(i32 %x) nounwind  {
9entry:
10	icmp sgt i32 %x, 1		; <i1>:0 [#uses=1]
11	br i1 %0, label %bb.nph, label %bb2
12
13bb.nph:		; preds = %entry
14	br label %bb
15
16bb:		; preds = %bb1, %bb.nph
17	%z.02 = phi i32 [ %1, %bb1 ], [ 1, %bb.nph ]		; <i32> [#uses=1]
18	%i.01 = phi i32 [ %2, %bb1 ], [ 1, %bb.nph ]		; <i32> [#uses=2]
19	mul i32 %z.02, %i.01		; <i32>:1 [#uses=2]
20	add i32 %i.01, 1		; <i32>:2 [#uses=2]
21	br label %bb1
22
23bb1:		; preds = %bb
24	icmp slt i32 %2, %x		; <i1>:3 [#uses=1]
25	br i1 %3, label %bb, label %bb1.bb2_crit_edge
26
27bb1.bb2_crit_edge:		; preds = %bb1
28	%.lcssa = phi i32 [ %1, %bb1 ]		; <i32> [#uses=1]
29	br label %bb2
30
31bb2:		; preds = %bb1.bb2_crit_edge, %entry
32	%z.0.lcssa = phi i32 [ %.lcssa, %bb1.bb2_crit_edge ], [ 1, %entry ]		; <i32> [#uses=1]
33	ret i32 %z.0.lcssa
34}
35