1// RUN: llvm-mc -filetype=obj -triple amdgcn-- -mcpu=kaveri -show-encoding %s | llvm-readobj -relocations | FileCheck %s
2
3// CHECK: Relocations [
4// CHECK: .rel.text {
5// CHECK: R_AMDGPU_ABS32_LO SCRATCH_RSRC_DWORD0 0x0
6// CHECK: R_AMDGPU_ABS32_HI SCRATCH_RSRC_DWORD1 0x0
7// CHECK: R_AMDGPU_GOTPCREL global_var0 0x0
8// CHECK: R_AMDGPU_GOTPCREL32_LO global_var1 0x0
9// CHECK: R_AMDGPU_GOTPCREL32_HI global_var2 0x0
10// CHECK: R_AMDGPU_REL32_LO global_var3 0x0
11// CHECK: R_AMDGPU_REL32_HI global_var4 0x0
12// CHECK: R_AMDGPU_ABS32_LO SCRATCH_RSRC_DWORD0 0x0
13// CHECK: R_AMDGPU_ABS32_HI SCRATCH_RSRC_DWORD1 0x0
14// CHECK: R_AMDGPU_GOTPCREL global_var0 0x0
15// CHECK: R_AMDGPU_GOTPCREL32_LO global_var1 0x0
16// CHECK: R_AMDGPU_GOTPCREL32_HI global_var2 0x0
17// CHECK: R_AMDGPU_REL32_LO global_var3 0x0
18// CHECK: R_AMDGPU_REL32_HI global_var4 0x0
19// CHECK: R_AMDGPU_ABS32 var 0x0
20// CHECK: }
21// CHECK: .rel.data {
22// CHECK: R_AMDGPU_ABS64 temp 0x0
23// CHECK: R_AMDGPU_REL64 temp 0x0
24// CHECK: }
25// CHECK: ]
26
27kernel:
28  s_mov_b32 s0, SCRATCH_RSRC_DWORD0
29  s_mov_b32 s1, SCRATCH_RSRC_DWORD1
30  s_mov_b32 s2, global_var0@GOTPCREL
31  s_mov_b32 s3, global_var1@gotpcrel32@lo
32  s_mov_b32 s4, global_var2@gotpcrel32@hi
33  s_mov_b32 s5, global_var3@rel32@lo
34  s_mov_b32 s6, global_var4@rel32@hi
35
36  v_mov_b32 v0, SCRATCH_RSRC_DWORD0
37  v_mov_b32 v1, SCRATCH_RSRC_DWORD1
38  v_mov_b32 v2, global_var0@GOTPCREL
39  v_mov_b32 v3, global_var1@gotpcrel32@lo
40  v_mov_b32 v4, global_var2@gotpcrel32@hi
41  v_mov_b32 v5, global_var3@rel32@lo
42  v_mov_b32 v6, global_var4@rel32@hi
43
44.globl global_var0
45.globl global_var1
46.globl global_var2
47.globl global_var3
48.globl global_var4
49
50.globl SCRATCH_RSRC_DWORD0
51
52.section nonalloc, "w", @progbits
53  .long var, common_var
54
55// 8 byte relocations
56	.type	ptr,@object
57	.data
58	.globl	ptr
59	.globl	foo
60	.p2align	3
61ptr:
62	.quad	temp
63	.size	ptr, 8
64foo:
65	.quad	temp@rel64
66	.size	foo, 8
67