summaryrefslogtreecommitdiff
path: root/test/Analysis/ScalarEvolution/2008-02-12-SMAXTripCount.ll
blob: 74e826847b35376b7c54f8711b089a4f5133b7ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; RUN: llvm-as < %s | opt -scalar-evolution -analyze | grep {Loop loop: (100 + (-100 smax %n)) iterations!}
; PR2002

define void @foo(i8 %n) {
entry:
	br label %loop
loop:
	%i = phi i8 [ -100, %entry ], [ %i.inc, %next ]
	%cond = icmp slt i8 %i, %n
	br i1 %cond, label %next, label %return
next:
        %i.inc = add i8 %i, 1
	br label %loop
return:
	ret void
}