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
3
4declare void @foo()
5
6define void @test1() nounwind {
7entry:
8  br label %for.cond
9
10for.cond:                                         ; preds = %if.end, %entry
11  %i.0 = phi i32 [ 2, %entry ], [ %dec, %if.end ]
12  switch i32 %i.0, label %if.end [
13    i32 0, label %for.end
14    i32 1, label %if.then
15  ]
16
17if.then:                                          ; preds = %for.cond
18  tail call void @foo()
19  br label %if.end
20
21if.end:                                           ; preds = %for.cond, %if.then
22  %dec = add nsw i32 %i.0, -1
23  br label %for.cond
24
25for.end:                                          ; preds = %for.cond
26  ret void
27
28; CHECK-LABEL: @test1
29; CHECK: Loop %for.cond: backedge-taken count is 2
30; CHECK: Loop %for.cond: max backedge-taken count is 2
31}
32