1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s --check-prefix CHECK-DEFAULT
2 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s --check-prefix CHECK-DEFAULT-32
3 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -nvptx-short-ptr | FileCheck %s --check-prefixes CHECK-SHORT-SHARED,CHECK-SHORT-CONST,CHECK-SHORT-LOCAL
5 ; RUN: %if ptxas && !ptxas-12.0 %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
6 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
7 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 -nvptx-short-ptr | %ptxas-verify %}
9 ; CHECK-DEFAULT: .visible .shared .align 8 .u64 s
10 ; CHECK-DEFAULT-32: .visible .shared .align 8 .u32 s
11 ; CHECK-SHORT-SHARED: .visible .shared .align 8 .u32 s
12 @s = local_unnamed_addr addrspace(3) global i32 addrspace(3)* null, align 8
14 ; CHECK-DEFAULT: .visible .const .align 8 .u64 c
15 ; CHECK-DEFAULT-32: .visible .const .align 8 .u32 c
16 ; CHECK-SHORT-CONST: .visible .const .align 8 .u32 c
17 @c = local_unnamed_addr addrspace(4) global i32 addrspace(4)* null, align 8
19 declare void @use(i8 %arg);
21 ; CHECK-DEFAULT: .param .b64 test1_param_0
22 ; CHECK-DEFAULT-32: .param .b32 test1_param_0
23 ; CHECK-SHORT-LOCAL: .param .b32 test1_param_0
24 define void @test1(i8 addrspace(5)* %local) {
25 ; CHECK-DEFAULT: ld.param.u64 %rd{{.*}}, [test1_param_0];
26 ; CHECK-DEFAULT-32: ld.param.u32 %r{{.*}}, [test1_param_0];
27 ; CHECK-SHORT-LOCAL: ld.param.u32 %r{{.*}}, [test1_param_0];
28 %v = load i8, i8 addrspace(5)* %local
33 define void @test2() {
35 %cast = addrspacecast i8* %v to i8 addrspace(5)*
36 ; CHECK-DEFAULT: .param .b64 param0;
37 ; CHECK-DEFAULT: st.param.b64
38 ; CHECK-DEFAULT-32: .param .b32 param0;
39 ; CHECK-DEFAULT-32: st.param.b32
40 ; CHECK-SHORT-LOCAL: .param .b32 param0;
41 ; CHECK-SHORT-LOCAL: st.param.b32
42 call void @test1(i8 addrspace(5)* %cast)