[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / AMDGPU / reloc.s
blob62cccb13e9060072be3fe7f12a4d03267d7130c1
1 // RUN: llvm-mc -filetype=obj -triple amdgcn-- -mcpu=kaveri -show-encoding %s | llvm-readobj -r - | FileCheck %s
3 // CHECK: Relocations [
4 // CHECK: .rel.text {
5 // CHECK: R_AMDGPU_ABS32_LO SCRATCH_RSRC_DWORD0
6 // CHECK: R_AMDGPU_ABS32_LO SCRATCH_RSRC_DWORD1
7 // CHECK: R_AMDGPU_GOTPCREL global_var0
8 // CHECK: R_AMDGPU_GOTPCREL32_LO global_var1
9 // CHECK: R_AMDGPU_GOTPCREL32_HI global_var2
10 // CHECK: R_AMDGPU_REL32_LO global_var3
11 // CHECK: R_AMDGPU_REL32_HI global_var4
12 // CHECK: R_AMDGPU_REL16 .text.unlikely
13 // CHECK: R_AMDGPU_ABS32 var
14 // CHECK: }
15 // CHECK: .rel.data {
16 // CHECK: R_AMDGPU_ABS64 temp
17 // CHECK: R_AMDGPU_REL64 temp
18 // CHECK: }
19 // CHECK: ]
21 kernel:
22 s_mov_b32 s0, SCRATCH_RSRC_DWORD0
23 s_mov_b32 s1, SCRATCH_RSRC_DWORD1
24 s_mov_b32 s2, global_var0@GOTPCREL
25 s_mov_b32 s3, global_var1@gotpcrel32@lo
26 s_mov_b32 s4, global_var2@gotpcrel32@hi
27 s_mov_b32 s5, global_var3@rel32@lo
28 s_mov_b32 s6, global_var4@rel32@hi
29 s_branch cold
31 .section .text.unlikely
32 cold:
33 s_add_i32 s15, s15, 1
35 .globl global_var0
36 .globl global_var1
37 .globl global_var2
38 .globl global_var3
39 .globl global_var4
41 .globl SCRATCH_RSRC_DWORD0
43 .section nonalloc, "w", @progbits
44 .long var, common_var
46 // 8 byte relocations
47 .type ptr,@object
48 .data
49 .globl ptr
50 .globl foo
51 .p2align 3
52 ptr:
53 .quad temp
54 .size ptr, 8
55 foo:
56 .quad temp@rel64
57 .size foo, 8