Add a test for folding a GEP into a load.
llvm-svn: 4139
diff --git a/llvm/test/Regression/LLC/select.ll b/llvm/test/Regression/LLC/select.ll
index 222fd36..db71355 100644
--- a/llvm/test/Regression/LLC/select.ll
+++ b/llvm/test/Regression/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 @@
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