From: Vikram S. Adve Date: Sun, 13 Oct 2002 00:44:00 +0000 (+0000) Subject: Add a test for folding a GEP into a load. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f289911a6cc0b8ed47e1eb2e3609a4eda0f54f97;p=oota-llvm.git 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 --- diff --git a/test/CodeGen/Generic/select.ll b/test/CodeGen/Generic/select.ll index 222fd369544..db713554697 100644 --- a/test/CodeGen/Generic/select.ll +++ b/test/CodeGen/Generic/select.ll @@ -1,5 +1,7 @@ %AConst = constant int 123 +%Domain = type { sbyte*, int, int*, int, int, int*, %Domain* } + implementation ; Test setting values of different constants in registers. @@ -193,3 +195,13 @@ begin ret void 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 diff --git a/test/LLC/select.ll b/test/LLC/select.ll index 222fd369544..db713554697 100644 --- a/test/LLC/select.ll +++ b/test/LLC/select.ll @@ -1,5 +1,7 @@ %AConst = constant int 123 +%Domain = type { sbyte*, int, int*, int, int, int*, %Domain* } + implementation ; Test setting values of different constants in registers. @@ -193,3 +195,13 @@ begin ret void 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