Add a test for folding a GEP into a load.
authorVikram S. Adve <vadve@cs.uiuc.edu>
Sun, 13 Oct 2002 00:44:00 +0000 (00:44 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Sun, 13 Oct 2002 00:44:00 +0000 (00:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4139 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/Generic/select.ll
test/LLC/select.ll

index 222fd369544b8c8b3cbc49ddefcaabb58627d94c..db713554697238e73e3971ddd54aa4ee606c75df 100644 (file)
@@ -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
index 222fd369544b8c8b3cbc49ddefcaabb58627d94c..db713554697238e73e3971ddd54aa4ee606c75df 100644 (file)
@@ -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