summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/IntPtrCast.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstCombine/IntPtrCast.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/IntPtrCast.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/IntPtrCast.ll b/llvm/test/Transforms/InstCombine/IntPtrCast.ll
new file mode 100644
index 00000000000..4ecbccd86a4
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/IntPtrCast.ll
@@ -0,0 +1,10 @@
+; RUN: opt < %s -instcombine -S | FileCheck %s
+target datalayout = "e-p:32:32"
+
+define i32* @test(i32* %P) {
+ %V = ptrtoint i32* %P to i32 ; <i32> [#uses=1]
+ %P2 = inttoptr i32 %V to i32* ; <i32*> [#uses=1]
+ ret i32* %P2
+; CHECK: ret i32* %P
+}
+
OpenPOWER on IntegriCloud