xref: /llvm-project/lld/test/ELF/amdgpu-relocs2.s (revision fb9c5c3dce27b352534641dbb6e3cb8c05da7bc9)
1# REQUIRES: amdgpu
2# RUN: split-file %s %t
3# RUN: llvm-mc -filetype=obj -triple=amdgcn--amdhsa -mcpu=fiji %t/asm -o %t.o
4# RUN: ld.lld %t.o -o %t/out --script %t/script
5# RUN: llvm-objdump -d %t/out | FileCheck %s
6
7
8#--- script
9SECTIONS {
10  . = 0x1000;
11  .text.likely : { *(.text.likely) }
12  . = 0x2000;
13  .text : { *(.text) }
14  . = 0x3000;
15  .text.unlikely : { *(.text.unlikely) }
16}
17
18
19#--- asm
20.section .text.likely
21hot1:
22  s_add_i32 s15, s15, 1
23hot2:
24  s_add_i32 s13, s13, 1
25.text
26foo:
27  s_branch cold2
28  s_branch hot2
29.section .text.unlikely
30cold1:
31  s_add_i32 s15, s15, 1
32  s_add_i32 s14, s14, 1
33cold2:
34  s_add_i32 s13, s13, 1
35
36# CHECK:  <foo>
37# CHECK-NEXT: s_branch 1025
38# CHECK-NEXT: s_branch 64511
39