aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorNadav Rotem <nadav.rotem@intel.com>2012-07-30 07:25:20 +0000
committerNadav Rotem <nadav.rotem@intel.com>2012-07-30 07:25:20 +0000
commit97baaeaeb22e7336590b8745bd181425ca410cb5 (patch)
tree16ea5ef3999bc25f30f31e696ecd683e5c5310eb /test/Transforms
parent818f6094591f18ee2cb19c4a09bec98443b8caac (diff)
downloadexternal_llvm-97baaeaeb22e7336590b8745bd181425ca410cb5.zip
external_llvm-97baaeaeb22e7336590b8745bd181425ca410cb5.tar.gz
external_llvm-97baaeaeb22e7336590b8745bd181425ca410cb5.tar.bz2
When constant folding GEP expressions, keep the address space information of pointers.
Together with Ran Chachick <ran.chachick@intel.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll b/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll
new file mode 100644
index 0000000..6f3df5b
--- /dev/null
+++ b/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll
@@ -0,0 +1,10 @@
+; RUN: opt < %s -instcombine -S | FileCheck %s
+; CHECK: bitcast
+
+@base = internal addrspace(3) unnamed_addr global [16 x i32] zeroinitializer, align 16
+declare void @foo(i32*)
+
+define void @test() nounwind {
+ call void @foo(i32* getelementptr (i32* bitcast ([16 x i32] addrspace(3)* @base to i32*), i64 2147483647)) nounwind
+ ret void
+}