mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Check in the first test: make sure getelementptr gets folded
llvm-svn: 2288
This commit is contained in:
parent
9a7a1140d1
commit
a1f5a1b920
10
test/Regression/Transforms/InstCombine/Makefile
Normal file
10
test/Regression/Transforms/InstCombine/Makefile
Normal 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) $<
|
21
test/Regression/Transforms/InstCombine/getelementptr.ll
Normal file
21
test/Regression/Transforms/InstCombine/getelementptr.ll
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user