1 ## Check that llvm-bolt correctly recognizes long absolute thunks generated
4 # RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
5 # RUN: %clang %cflags -fno-PIC -no-pie %t.o -o %t.exe -nostdlib \
6 # RUN: -fuse-ld=lld -Wl,-q
7 # RUN: llvm-objdump -d %t.exe | FileCheck --check-prefix=CHECK-INPUT %s
8 # RUN: llvm-objcopy --remove-section .rela.mytext %t.exe
9 # RUN: llvm-bolt %t.exe -o %t.bolt --elim-link-veneers=true --lite=0
10 # RUN: llvm-objdump -d -j .text %t.bolt | \
11 # RUN: FileCheck --check-prefix=CHECK-OUTPUT %s
22 .section ".mytext", "ax"
25 .global __AArch64AbsLongThunk_foo
26 .type __AArch64AbsLongThunk_foo, %function
27 __AArch64AbsLongThunk_foo
:
30 # CHECK-INPUT-LABEL: <__AArch64AbsLongThunk_foo>:
31 # CHECK-INPUT-NEXT: ldr
32 # CHECK-INPUT-NEXT: br
35 .size __AArch64AbsLongThunk_foo, .-__AArch64AbsLongThunk_foo
37 ## Check that the thunk was removed from .text and _start() calls foo()
40 # CHECK-OUTPUT-NOT: __AArch64AbsLongThunk_foo
43 .type _start, %function
45 # CHECK-INPUT-LABEL: <_start>:
46 # CHECK-OUTPUT-LABEL: <_start>:
47 bl __AArch64AbsLongThunk_foo
48 # CHECK-INPUT-NEXT: bl {{.*}} <__AArch64AbsLongThunk_foo>
49 # CHECK-OUTPUT-NEXT: bl {{.*}} <foo>
51 .size _start, .-_start