summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/constant-fold-address-space-pointer.ll
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-09-17 23:23:16 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-09-17 23:23:16 +0000
commit2334b0e8023bc382585a08386510cf29b3d541a6 (patch)
tree179bdc4106993e50616a416efd63688d63d250c8 /test/Transforms/InstCombine/constant-fold-address-space-pointer.ll
parent28860823ad34d41d4f58561dc14a982fb0843fdd (diff)
downloadllvm-2334b0e8023bc382585a08386510cf29b3d541a6.tar.gz
llvm-2334b0e8023bc382585a08386510cf29b3d541a6.tar.bz2
llvm-2334b0e8023bc382585a08386510cf29b3d541a6.tar.xz
Fix a constant folding address space place I missed.
If address space 0 was smaller than the address space in a constant inttoptr/ptrtoint pair, the wrong mask size would be used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/constant-fold-address-space-pointer.ll')
-rw-r--r--test/Transforms/InstCombine/constant-fold-address-space-pointer.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/constant-fold-address-space-pointer.ll b/test/Transforms/InstCombine/constant-fold-address-space-pointer.ll
index 9b17847cbd..f3a474a851 100644
--- a/test/Transforms/InstCombine/constant-fold-address-space-pointer.ll
+++ b/test/Transforms/InstCombine/constant-fold-address-space-pointer.ll
@@ -74,6 +74,14 @@ define i8 @const_fold_ptrtoint_mask() {
ret i8 ptrtoint (i32 addrspace(3)* inttoptr (i32 257 to i32 addrspace(3)*) to i8)
}
+; Address space 0 is too small for the correct mask, should mask with
+; 64-bits instead of 32
+define i64 @const_fold_ptrtoint_mask_small_as0() {
+; CHECK-LABEL: @const_fold_ptrtoint_mask_small_as0(
+; CHECK: ret i64 -1
+ ret i64 ptrtoint (i32 addrspace(1)* inttoptr (i128 -1 to i32 addrspace(1)*) to i64)
+}
+
define i32 addrspace(3)* @const_inttoptr() {
; CHECK-LABEL: @const_inttoptr(
; CHECK-NEXT: ret i32 addrspace(3)* inttoptr (i16 4 to i32 addrspace(3)*)