[LV] Add test showing debug output for loops with uncountable BTCs.
[llvm-project.git] / bolt / test / AArch64 / adr-relaxation.s
blob0aa3c71f29aaab4994e37811c9a8c8dcdda48ddc
1 ## Check that llvm-bolt will not unnecessarily relax ADR instruction.
3 # RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
4 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -static
5 # RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=random2
6 # RUN: llvm-objdump -d --disassemble-symbols=_start %t.bolt | FileCheck %s
7 # RUN: llvm-objdump -d --disassemble-symbols=foo.cold.0 %t.bolt \
8 # RUN: | FileCheck --check-prefix=CHECK-FOO %s
10 ## ADR below references its containing function that is split. But ADR is always
11 ## in the main fragment, thus there is no need to relax it.
12 .text
13 .globl _start
14 .type _start, %function
15 _start:
16 # CHECK: <_start>:
17 .cfi_startproc
18 adr x1, _start
19 # CHECK-NOT: adrp
20 # CHECK: adr
21 cmp x1, x11
22 b.hi .L1
23 mov x0, #0x0
24 .L1:
25 ret x30
26 .cfi_endproc
27 .size _start, .-_start
30 ## In foo, ADR is in the split fragment but references the main one. Thus, it
31 ## needs to be relaxed into ADRP + ADD.
32 .globl foo
33 .type foo, %function
34 foo:
35 .cfi_startproc
36 cmp x1, x11
37 b.hi .L2
38 mov x0, #0x0
39 .L2:
40 # CHECK-FOO: <foo.cold.0>:
41 adr x1, foo
42 # CHECK-FOO: adrp
43 # CHECK-FOO-NEXT: add
44 ret x30
45 .cfi_endproc
46 .size foo, .-foo
48 ## Force relocation mode.
49 .reloc 0, R_AARCH64_NONE