Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / RISCV / reloc-bb-split.s
blob5995562cf130b07083c967d4797a141a6e9472e3
1 // RUN: %clang %cflags -o %t %s
2 // RUN: llvm-bolt --print-cfg --print-only=_start -o /dev/null %t \
3 // RUN: | FileCheck %s
5 .data
6 .globl d
7 .p2align 3
8 d:
9 .dword 0
11 .text
12 .globl _start
13 .p2align 1
14 // CHECK-LABEL: Binary Function "_start" after building cfg {
15 _start:
16 /// The local label is used for %pcrel_lo as well as a jump target so a new
17 /// basic block should start there.
18 // CHECK-LABEL: {{^}}.LBB00
19 // CHECK: nop
20 // CHECK-LABEL: {{^}}.Ltmp0
21 // CHECK: auipc t0, %pcrel_hi(d) # Label: .Ltmp1
22 // CHECK-NEXT: ld t0, %pcrel_lo(.Ltmp1)(t0)
23 // CHECK-NEXT: j .Ltmp0
24 nop
26 auipc t0, %pcrel_hi(d)
27 ld t0, %pcrel_lo(1b)(t0)
28 j 1b
30 /// The local label is used only for %pcrel_lo so no new basic block should
31 /// start there.
32 // CHECK-LABEL: {{^}}.LFT0
33 // CHECK: nop
34 // CHECK-NEXT: auipc t0, %pcrel_hi(d) # Label: .Ltmp2
35 // CHECK-NEXT: ld t0, %pcrel_lo(.Ltmp2)(t0)
36 // CHECK-NEXT: ret
37 nop
39 auipc t0, %pcrel_hi(d)
40 ld t0, %pcrel_lo(1b)(t0)
41 ret
42 .size _start, .-_start