llvm-project/bolt/test/AArch64/patch-entries.s
Vladislav Khmelevsky 485075c095
[BOLT][AArch64] Don't change layout in PatchEntries (#71278)
Due to LongJmp pass that is executed before PatchEntries we can't ignore
the function here since it would change pre-calculated output layout.
The test reloc-26 relied on the wrong behavior, rewritten to unittest.
This is also attemp to fix #70771
2023-11-08 11:38:46 +04:00

37 lines
835 B
ArmAsm

# This test checks patch entries functionality
# REQUIRES: system-linux
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \
# RUN: %s -o %t.o
# RUN: %clang %cflags -pie %t.o -o %t.exe -nostdlib -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.bolt --use-old-text=0 --lite=0 --skip-funcs=_start
# RUN: llvm-objdump -dz %t.bolt | FileCheck %s
# CHECK: <pathedEntries.org.0>:
# CHECK-NEXT: adrp x16, 0x[[#%x,ADRP:]]
# CHECK-NEXT: add x16, x16, #0x[[#%x,ADD:]]
# CHECK-NEXT: br x16
# CHECK: [[#ADRP + ADD]] <pathedEntries>:
# CHECK-NEXT: [[#ADRP + ADD]]: {{.*}} ret
.text
.balign 4
.global pathedEntries
.type pathedEntries, %function
pathedEntries:
.rept 32
nop
.endr
ret
.size pathedEntries, .-pathedEntries
.global _start
.type _start, %function
_start:
bl pathedEntries
.inst 0xdeadbeef
ret
.size _start, .-_start