Add a test for folding a GEP into a load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4139 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vikram S. Adve 2002-10-13 00:44:00 +00:00
parent 1632e882f1
commit f289911a6c
2 changed files with 24 additions and 0 deletions

View File

@ -1,5 +1,7 @@
%AConst = constant int 123 %AConst = constant int 123
%Domain = type { sbyte*, int, int*, int, int, int*, %Domain* }
implementation implementation
; Test setting values of different constants in registers. ; Test setting values of different constants in registers.
@ -193,3 +195,13 @@ begin
ret void ret void
end end
; Test case for folding getelementptr into a load/store
;
int "checkFoldGEP"(%Domain* %D, long %idx)
begin
%reg841 = getelementptr %Domain* %D, long 0, ubyte 2, long %idx
%reg820 = load int* %reg841
ret int %reg820
end

View File

@ -1,5 +1,7 @@
%AConst = constant int 123 %AConst = constant int 123
%Domain = type { sbyte*, int, int*, int, int, int*, %Domain* }
implementation implementation
; Test setting values of different constants in registers. ; Test setting values of different constants in registers.
@ -193,3 +195,13 @@ begin
ret void ret void
end end
; Test case for folding getelementptr into a load/store
;
int "checkFoldGEP"(%Domain* %D, long %idx)
begin
%reg841 = getelementptr %Domain* %D, long 0, ubyte 2, long %idx
%reg820 = load int* %reg841
ret int %reg820
end