1; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2
3
4declare i8 @llvm.nvvm.ldu.global.i.i8.p1i8(i8 addrspace(1)* %ptr, i32 %align)
5declare i32 @llvm.nvvm.ldu.global.i.i32.p1i32(i32 addrspace(1)* %ptr, i32 %align)
6declare i8 @llvm.nvvm.ldg.global.i.i8.p1i8(i8 addrspace(1)* %ptr, i32 %align)
7declare i32 @llvm.nvvm.ldg.global.i.i32.p1i32(i32 addrspace(1)* %ptr, i32 %align)
8
9
10; CHECK: func0
11define i8 @func0(i8 addrspace(1)* %ptr) {
12; ldu.global.u8
13  %val = tail call i8 @llvm.nvvm.ldu.global.i.i8.p1i8(i8 addrspace(1)* %ptr, i32 4)
14  ret i8 %val
15}
16
17; CHECK: func1
18define i32 @func1(i32 addrspace(1)* %ptr) {
19; ldu.global.u32
20  %val = tail call i32 @llvm.nvvm.ldu.global.i.i32.p1i32(i32 addrspace(1)* %ptr, i32 4)
21  ret i32 %val
22}
23
24; CHECK: func2
25define i8 @func2(i8 addrspace(1)* %ptr) {
26; ld.global.nc.u8
27  %val = tail call i8 @llvm.nvvm.ldg.global.i.i8.p1i8(i8 addrspace(1)* %ptr, i32 4)
28  ret i8 %val
29}
30
31; CHECK: func3
32define i32 @func3(i32 addrspace(1)* %ptr) {
33; ld.global.nc.u32
34  %val = tail call i32 @llvm.nvvm.ldg.global.i.i32.p1i32(i32 addrspace(1)* %ptr, i32 4)
35  ret i32 %val
36}
37