diff options
author | Micah Villmow <villmow@gmail.com> | 2012-10-24 15:52:52 +0000 |
---|---|---|
committer | Micah Villmow <villmow@gmail.com> | 2012-10-24 15:52:52 +0000 |
commit | aa76e9e2cf50af190de90bc778b7f7e42ef9ceff (patch) | |
tree | 5206b0fb0ac695e3ab1c9cf434b5a85195abf336 /test/Other | |
parent | 3575222175b4982f380ff291bb17be67aadc0966 (diff) | |
download | external_llvm-aa76e9e2cf50af190de90bc778b7f7e42ef9ceff.zip external_llvm-aa76e9e2cf50af190de90bc778b7f7e42ef9ceff.tar.gz external_llvm-aa76e9e2cf50af190de90bc778b7f7e42ef9ceff.tar.bz2 |
Add in support for getIntPtrType to get the pointer type based on the address space.
This checkin also adds in some tests that utilize these paths and updates some of the
clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166578 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Other')
-rw-r--r-- | test/Other/multi-pointer-size.ll | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/Other/multi-pointer-size.ll b/test/Other/multi-pointer-size.ll new file mode 100644 index 0000000..95fa54b --- /dev/null +++ b/test/Other/multi-pointer-size.ll @@ -0,0 +1,43 @@ +; RUN: opt -instcombine %s | llvm-dis | FileCheck %s +target datalayout = "e-p:32:32:32-p1:64:64:64-p2:8:8:8-p3:16:16:16--p4:96:96:96-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32" + +define i32 @test_as0(i32 addrspace(0)* %A) { +entry: +; CHECK: %arrayidx = getelementptr i32* %A, i32 1 + %arrayidx = getelementptr i32 addrspace(0)* %A, i64 1 + %y = load i32 addrspace(0)* %arrayidx, align 4 + ret i32 %y +} + +define i32 @test_as1(i32 addrspace(1)* %A) { +entry: +; CHECK: %arrayidx = getelementptr i32 addrspace(1)* %A, i64 1 + %arrayidx = getelementptr i32 addrspace(1)* %A, i32 1 + %y = load i32 addrspace(1)* %arrayidx, align 4 + ret i32 %y +} + +define i32 @test_as2(i32 addrspace(2)* %A) { +entry: +; CHECK: %arrayidx = getelementptr i32 addrspace(2)* %A, i8 1 + %arrayidx = getelementptr i32 addrspace(2)* %A, i32 1 + %y = load i32 addrspace(2)* %arrayidx, align 4 + ret i32 %y +} + +define i32 @test_as3(i32 addrspace(3)* %A) { +entry: +; CHECK: %arrayidx = getelementptr i32 addrspace(3)* %A, i16 1 + %arrayidx = getelementptr i32 addrspace(3)* %A, i32 1 + %y = load i32 addrspace(3)* %arrayidx, align 4 + ret i32 %y +} + +define i32 @test_as4(i32 addrspace(4)* %A) { +entry: +; CHECK: %arrayidx = getelementptr i32 addrspace(4)* %A, i96 1 + %arrayidx = getelementptr i32 addrspace(4)* %A, i32 1 + %y = load i32 addrspace(4)* %arrayidx, align 4 + ret i32 %y +} + |