Add correct NEON encodings for the "multiple single elements" form of vld.
[oota-llvm.git] / test / Transforms / InstCombine / getelementptr.ll
index aa39752c4602b87ed6d823fe138b5b5bcdcfd8e0..9e8547b684b1fac1890dc5d11033637b05035bdb 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt %s -instcombine -S | FileCheck %s
+; RUN: opt %s -instcombine -S | FileCheck %s
 
 target datalayout = "e-p:64:64"
 %intstruct = type { i32 }
@@ -58,7 +58,7 @@ define i32* @test6() {
         %B = getelementptr i32* %A, i64 2             
         ret i32* %B
 ; CHECK: @test6
-; CHECK: getelementptr [4 x i32]* %M, i64 0, i64 2
+; CHECK: getelementptr i8* %malloccall, i64 8
 }
 
 define i32* @test7(i32* %I, i64 %C, i64 %D) {
@@ -222,7 +222,7 @@ define i1 @test22() {
                            getelementptr (i32* @B, i64 2) 
         ret i1 %C
 ; CHECK: @test22
-; CHECK: icmp ult (i32* getelementptr (i32* @A, i64 1), i32* getelementptr (i32* @B, i64 2))
+; CHECK: icmp ult (i32* getelementptr inbounds (i32* @A, i64 1), i32* getelementptr (i32* @B, i64 2))
 }
 
 
@@ -246,7 +246,7 @@ bc0:
         store i32 0, i32* %tmp53
         ret void
 ; CHECK: @test24
-; CHECK: store i32 0, i32* getelementptr (%"java/lang/StringBuffer"* null, i32 0, i32 1)
+; CHECK: store i32 0, i32* getelementptr (%"java/lang/StringBuffer"* null, i64 0, i32 1)
 }
 
 define void @test25() {
@@ -445,7 +445,7 @@ define i32 @test35() nounwind {
              i8* getelementptr (%t1* bitcast (%t0* @s to %t1*), i32 0, i32 1, i32 0)) nounwind
   ret i32 0
 ; CHECK: @test35
-; CHECK: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @"\01LC8", i64 0, i64 0), i8* bitcast (i8** getelementptr (%t1* bitcast (%t0* @s to %t1*), i64 1, i32 0) to i8*)) nounwind
+; CHECK: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @"\01LC8", i64 0, i64 0), i8* getelementptr inbounds (%t0* @s, i64 0, i32 1, i64 0)) nounwind
 }
 
 ; Instcombine should constant-fold the GEP so that indices that have
@@ -459,3 +459,21 @@ define i8* @test36() nounwind {
 ; CHECK: ret i8* getelementptr ([11 x i8]* @array, i64 1676976733973595601, i64 4)
 }
 
+; Instcombine shouldn't assume that gep(A,0,1) != gep(A,1,0).
+@A37 = external constant [1 x i8]
+define i1 @test37() nounwind {
+; CHECK: @test37
+; CHECK: ret i1 true
+  %t = icmp eq i8* getelementptr ([1 x i8]* @A37, i64 0, i64 1),
+                   getelementptr ([1 x i8]* @A37, i64 1, i64 0)
+  ret i1 %t
+}
+
+; Test index promotion
+define i32* @test38(i32* %I, i32 %n) {
+        %A = getelementptr i32* %I, i32 %n
+        ret i32* %A
+; CHECK: @test38
+; CHECK: = sext i32 %n to i64
+; CHECK: %A = getelementptr i32* %I, i64 %
+}