llvm-project/bolt/test/X86/fptr-addend-pcrel.s
Amir Ayupov ab14eb23b6
[BOLT][test] Replace /dev/null with temp file (#73485)
NFC processing time script identifies tests by output filename.
When `/dev/null` is used as output filename, we're unable to tell the
source test, and the reports are unhelpful.
Replace `/dev/null/` with `%t.null` which resolves the issue.
2023-11-27 10:53:18 -08:00

36 lines
799 B
ArmAsm

## Check that BOLT correctly recognizes pc-relative function pointer
## reference with an addend.
# REQUIRES: system-linux
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: ld.lld %t.o -o %t.exe -q
# RUN: llvm-bolt %t.exe --relocs -o %t.null --print-only=foo --print-disasm \
# RUN: | FileCheck %s
.text
.globl _start
.type _start,@function
_start:
.cfi_startproc
call foo
retq
.size _start, .-_start
.cfi_endproc
.globl foo
.type foo,@function
foo:
.cfi_startproc
leaq foo-1(%rip), %rax
## Check that the instruction references foo with a negative addend,
## not the previous function with a positive addend (_start+X).
#
# CHECK: leaq foo-1(%rip), %rax
retq
.size foo, .-foo
.cfi_endproc