Check in the first test: make sure getelementptr gets folded

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2288 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-04-18 15:39:50 +00:00
parent 88f2501eda
commit dce153e112
2 changed files with 31 additions and 0 deletions

View File

@ -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) $<

View File

@ -0,0 +1,21 @@
; The %A getelementptr instruction should be eliminated here
; RUN: if as < %s | opt -instcombine -dce | dis | grep getelementptr | grep -v '%C'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int *"foo"(int * %I)
begin
%A = getelementptr int* %I, uint 17
store int 23, int* %A
%B = load int* %A
store int %B, int* %A, uint 0
%C = getelementptr int* %A
ret int* %C
end