1 ## This test checks processing of R_AARCH64_CALL26 relocation
2 ## when option `--funcs` is enabled
4 ## We want to test on relocations against functions with both higher
5 ## and lower addresses. The '--force-patch' option is used to prevent
6 ## the functions func1 and func2 from being optimized, so that their
7 ## addresses can remain unchanged. Therefore, the relocations can be
8 ## updated via encodeValueAArch64 and the address order in the output
9 ## binary is func1 < _start < func2.
11 # REQUIRES: system-linux
13 # RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \
15 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
16 # RUN: llvm-bolt %t.exe -o %t.bolt --funcs=func1,func2 \
17 # RUN: --force-patch 2>&1 | FileCheck %s -check-prefix=CHECK-BOLT
18 # RUN: llvm-objdump -d --disassemble-symbols='_start' %t.bolt | \
20 # RUN: llvm-nm --numeric-sort --extern-only %t.bolt | FileCheck \
21 # RUN: %s -check-prefix=CHECK-FUNC-ORDER
23 # CHECK-BOLT: BOLT-WARNING: failed to patch entries in func1. The function will not be optimized.
24 # CHECK-BOLT: BOLT-WARNING: failed to patch entries in func2. The function will not be optimized.
25 # CHECK: {{.*}} bl {{.*}} <func1>
26 # CHECK: {{.*}} bl {{.*}} <func2>
28 # CHECK-FUNC-ORDER: {{.*}} func1
29 # CHECK-FUNC-ORDER-NEXT: {{.*}} _start
30 # CHECK-FUNC-ORDER-NEXT: {{.*}} func2
35 .type func1, %function
40 .type _start, %function
46 .size _start, .-_start
48 .type func2, %function