[LV] Add test showing debug output for loops with uncountable BTCs.
[llvm-project.git] / bolt / test / AArch64 / pad-before-funcs.s
blobf3e8a23ddfdda63882d7be4641ff6a63ef01a643
1 # Test checks that --pad-before-funcs is working as expected.
2 # It should be able to introduce a configurable offset for the _start symbol.
3 # It should reject requests which don't obey the code alignment requirement.
5 # Tests check inserting padding before _start; and additionally a test where
6 # padding is inserted after start. In each case, check that the following
7 # symbol ends up in the expected place as well.
10 # RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
11 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -Wl,--section-start=.text=0x4000
12 # RUN: llvm-bolt %t.exe -o %t.bolt.0 --pad-funcs-before=_start:0
13 # RUN: llvm-bolt %t.exe -o %t.bolt.4 --pad-funcs-before=_start:4
14 # RUN: llvm-bolt %t.exe -o %t.bolt.8 --pad-funcs-before=_start:8
15 # RUN: llvm-bolt %t.exe -o %t.bolt.4.4 --pad-funcs-before=_start:4 --pad-funcs=_start:4
16 # RUN: llvm-bolt %t.exe -o %t.bolt.4.8 --pad-funcs-before=_start:4 --pad-funcs=_start:8
18 # RUN: not llvm-bolt %t.exe -o %t.bolt.8 --pad-funcs-before=_start:1 2>&1 | FileCheck --check-prefix=CHECK-BAD-ALIGN %s
20 # CHECK-BAD-ALIGN: user-requested 1 padding bytes before function _start(*2) is not a multiple of the minimum function alignment (4).
22 # RUN: llvm-objdump --section=.text --disassemble %t.bolt.0 | FileCheck --check-prefix=CHECK-0 %s
23 # RUN: llvm-objdump --section=.text --disassemble %t.bolt.4 | FileCheck --check-prefix=CHECK-4 %s
24 # RUN: llvm-objdump --section=.text --disassemble %t.bolt.8 | FileCheck --check-prefix=CHECK-8 %s
25 # RUN: llvm-objdump --section=.text --disassemble %t.bolt.4.4 | FileCheck --check-prefix=CHECK-4-4 %s
26 # RUN: llvm-objdump --section=.text --disassemble %t.bolt.4.8 | FileCheck --check-prefix=CHECK-4-8 %s
28 # Trigger relocation mode in bolt.
29 .reloc 0, R_AARCH64_NONE
31 .section .text
33 # CHECK-0: 0000000000400000 <_start>
34 # CHECK-4: 0000000000400004 <_start>
35 # CHECK-4-4: 0000000000400004 <_start>
36 # CHECK-8: 0000000000400008 <_start>
37 .globl _start
38 _start:
39 ret
41 # CHECK-0: 0000000000400004 <_subsequent>
42 # CHECK-4: 0000000000400008 <_subsequent>
43 # CHECK-4-4: 000000000040000c <_subsequent>
44 # CHECK-4-8: 0000000000400010 <_subsequent>
45 # CHECK-8: 000000000040000c <_subsequent>
46 .globl _subsequent
47 _subsequent:
48 ret