llvm-6502/test/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll
Chris Lattner 7a4e86d20e Add new testcase for broken indvars case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3642 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 04:54:44 +00:00

17 lines
390 B
LLVM

; Induction variable pass is doing bad things with pointer induction vars,
; trying to do arithmetic on them directly.
;
; RUN: 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
}