aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll
blob: b5eb9fc4878df170068c694ab11793dc044725f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
; PR1533

@array = weak global [101 x i32] zeroinitializer, align 32		; <[100 x i32]*> [#uses=1]

; CHECK: Loop %bb: backedge-taken count is 100

define void @loop(i32 %x) {
entry:
	br label %bb

bb:		; preds = %bb, %entry
	%i.01.0 = phi i32 [ 100, %entry ], [ %tmp4, %bb ]		; <i32> [#uses=2]
	%tmp1 = getelementptr [101 x i32]* @array, i32 0, i32 %i.01.0		; <i32*> [#uses=1]
	store i32 %x, i32* %tmp1
	%tmp4 = add i32 %i.01.0, -1		; <i32> [#uses=2]
	%tmp7 = icmp sgt i32 %tmp4, -1		; <i1> [#uses=1]
	br i1 %tmp7, label %bb, label %return

return:		; preds = %bb
	ret void
}