InstCombine: Fix and simplify the inttoptr side too.
[oota-llvm.git] / test / Transforms / InstCombine / ptr-int-cast.ll
index 40a1bc220a4f44cd5a6d27e4a874b7fd4036e8ac..7a6ecff9c0be095393907a05d2062f5cb4e10942 100644 (file)
@@ -42,3 +42,19 @@ define <4 x i128> @test5(<4 x i8*> %arg) nounwind {
   %p1 = ptrtoint <4 x i8*> %arg to <4 x i128>
   ret <4 x i128> %p1
 }
+
+define <4 x i8*> @test6(<4 x i32> %arg) nounwind {
+; CHECK: @test6
+; CHECK: zext <4 x i32> %arg to <4 x i64>
+; CHECK: inttoptr <4 x i64> %1 to <4 x i8*>
+  %p1 = inttoptr <4 x i32> %arg to <4 x i8*>
+  ret <4 x i8*> %p1
+}
+
+define <4 x i8*> @test7(<4 x i128> %arg) nounwind {
+; CHECK: @test7
+; CHECK: trunc <4 x i128> %arg to <4 x i64>
+; CHECK: inttoptr <4 x i64> %1 to <4 x i8*>
+  %p1 = inttoptr <4 x i128> %arg to <4 x i8*>
+  ret <4 x i8*> %p1
+}