Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / AArch64 / reloc-call26.s
blob42e4f7f2b43786fcdd72ba4a614e93562b380fe8
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 \
14 # RUN: %s -o %t.o
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 | \
19 # RUN: FileCheck %s
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
32 .text
33 .align 4
34 .global func1
35 .type func1, %function
36 func1:
37 ret
38 .size func1, .-func1
39 .global _start
40 .type _start, %function
41 _start:
42 bl func1
43 bl func2
44 mov w8, #93
45 svc #0
46 .size _start, .-_start
47 .global func2
48 .type func2, %function
49 func2:
50 ret
51 .size func2, .-func2