1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
2 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
4 ; CHECK: .visible .global .align 4 .u32 g = 42;
5 ; CHECK: .visible .global .align 1 .b8 ga[4] = {0, 1, 2, 3};
6 ; CHECK: .visible .global .align 8 .u64 g2 = generic(g);
7 ; CHECK: .visible .global .align 8 .u64 g3 = g;
8 ; CHECK: .visible .global .align 8 .u64 g4[2] = {0, generic(g)};
9 ; CHECK: .visible .global .align 8 .u64 g5[2] = {0, generic(g)+8};
11 @g = addrspace(1) global i32 42
12 @ga = addrspace(1) global [4 x i8] c"\00\01\02\03"
13 @g2 = addrspace(1) global ptr addrspacecast (ptr addrspace(1) @g to ptr)
14 @g3 = addrspace(1) global ptr addrspace(1) @g
15 @g4 = constant {ptr, ptr} {ptr null, ptr addrspacecast (ptr addrspace(1) @g to ptr)}
16 @g5 = constant {ptr, ptr} {ptr null, ptr addrspacecast (ptr addrspace(1) getelementptr (i32, ptr addrspace(1) @g, i32 2) to ptr)}
18 ; CHECK: .visible .global .align 8 .u64 g6 = generic(ga)+2;
19 @g6 = addrspace(1) global ptr getelementptr inbounds (
20 [4 x i8], ptr addrspacecast (ptr addrspace(1) @ga to ptr),
24 ; CHECK: .visible .global .align 8 .u64 g7 = generic(g);
25 @g7 = addrspace(1) global ptr addrspacecast (
30 ; CHECK: .visible .global .align 8 .u64 g8[2] = {0, g};
31 @g8 = addrspace(1) global [2 x ptr addrspace(1)] [ptr addrspace(1) null, ptr addrspace(1) @g]
33 ; CHECK: .visible .global .align 8 .u64 g9[2] = {0, generic(g)};
34 @g9 = addrspace(1) global [2 x ptr] [
36 ptr addrspacecast (ptr addrspace(1) @g to ptr)
39 ; CHECK: .visible .global .align 8 .u64 g10[2] = {0, g};
40 @g10 = addrspace(1) global [2 x ptr addrspace(1)] [
41 ptr addrspace(1) null,
45 ; CHECK: .visible .global .align 8 .u64 g11[2] = {0, generic(g)};
46 @g11 = addrspace(1) global [2 x ptr] [
48 ptr addrspacecast (ptr addrspace(1) @g to ptr)