aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll
blob: 81a02771a7c0a8acbacc1425542caba73c212e8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; Induction variable pass is doing bad things with pointer induction vars, 
; trying to do arithmetic on them directly.
;
; RUN: llvm-as < %s | opt -indvars
;
void %test(int %A, uint %S, sbyte* %S) {

	br label %Loop
Loop:
	%PIV = phi sbyte* [%S, %0], [%PIVNext, %Loop]

	%PIV = cast sbyte* %PIV to ulong
	%PIVNext = add ulong %PIV, 8
	%PIVNext = cast ulong %PIVNext to sbyte*
	br label %Loop
}