Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / RISCV / reloc-tls.s
blob44195818277f5468489ff36ed09b488e9532bca4
1 // RUN: llvm-mc -triple riscv64 -filetype obj -o %t.o %s
2 // RUN: ld.lld --emit-relocs -o %t %t.o
3 // RUN: llvm-bolt --print-cfg --print-only=tls_le,tls_ie -o /dev/null %t \
4 // RUN: | FileCheck %s
6 // CHECK-LABEL: Binary Function "tls_le{{.*}}" after building cfg {
7 // CHECK: lui a5, 0
8 // CHECK-NEXT: add a5, a5, tp
9 // CHECK-NEXT: lw t0, 0(a5)
10 // CHECK-NEXT: sw t0, 0(a5)
12 // CHECK-LABEL: Binary Function "tls_ie" after building cfg {
13 // CHECK-LABEL: .LBB01
14 // CHECK: auipc a0, %pcrel_hi(__BOLT_got_zero+{{[0-9]+}})
15 // CHECK-NEXT: ld a0, %pcrel_lo(.Ltmp0)(a0)
16 .text
17 .globl tls_le, _start
18 .p2align 2
19 tls_le:
20 _start:
21 nop
22 lui a5, %tprel_hi(i)
23 add a5, a5, tp, %tprel_add(i)
24 lw t0, %tprel_lo(i)(a5)
25 sw t0, %tprel_lo(i)(a5)
26 ret
27 .size _start, .-_start
29 .globl tls_ie
30 .p2align 2
31 tls_ie:
32 nop
33 la.tls.ie a0, i
34 ret
35 .size tls_ie, .-tls_ie
37 .section .tbss,"awT",@nobits
38 .type i,@object
39 .globl i
40 .p2align 3
42 .quad 0
43 .size i, .-i