From 7a4e86d20e4bda41822c1bddf2dc09721cd6222d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 10 Sep 2002 04:54:44 +0000 Subject: [PATCH] Add new testcase for broken indvars case git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3642 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../IndVarsSimplify/2002-09-09-PointerIndVar.ll | 16 ++++++++++++++++ test/Transforms/IndVarsSimplify/Makefile | 10 ++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll create mode 100644 test/Transforms/IndVarsSimplify/Makefile diff --git a/test/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll b/test/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll new file mode 100644 index 00000000000..678b062b01e --- /dev/null +++ b/test/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll @@ -0,0 +1,16 @@ +; 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 +} diff --git a/test/Transforms/IndVarsSimplify/Makefile b/test/Transforms/IndVarsSimplify/Makefile new file mode 100644 index 00000000000..91acd4d481b --- /dev/null +++ b/test/Transforms/IndVarsSimplify/Makefile @@ -0,0 +1,10 @@ + +LEVEL = ../../../.. +include $(LEVEL)/test/Makefile.tests + +TESTS := $(wildcard *.ll) + +all:: $(addprefix Output/, $(TESTS:%.ll=%.ll.out)) + +Output/%.ll.out: %.ll Output/.dir $(LOPT) + -$(TESTRUNR) $<