Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / RISCV / internal-func-reloc.s
blobc6c74bed92efea73c9495817955ed62b4d171c27
1 /// Check that functions with internal relocations are considered "simple" and
2 /// get transformed by BOLT. The tests rely on the "remove-nops" optimization:
3 /// if nops got removed from the function, it got transformed by BOLT.
5 // RUN: llvm-mc -triple riscv64 -filetype=obj -o %t.o %s
6 // RUN: ld.lld --emit-relocs -o %t %t.o
7 // RUN: llvm-bolt -o %t.bolt %t
8 // RUN: llvm-objdump -d %t.bolt | FileCheck %s
10 .text
11 .globl _start
12 .p2align 2
13 // CHECK: <_start>:
14 // CHECK-NEXT: j 0x{{.*}} <_start>
15 _start:
16 nop
18 j 1b
19 .size _start, .-_start
21 .globl f
22 .p2align 2
23 // CHECK: <f>:
24 // CHECK-NEXT: auipc a0, [[#]]
25 // CHECK-NEXT: addi a0, a0, [[#]]
27 nop
29 /// Same as "la a0, g" but more explicit
30 auipc a0, %pcrel_hi(g)
31 addi a0, a0, %pcrel_lo(1b)
32 ret
33 .size f, .-f
35 .globl g
36 .p2align 2
38 ret
39 .size g, .-g