1## Check that BOLT correctly recognizes pc-relative function pointer 2## reference with an addend. 3 4# REQUIRES: system-linux 5 6# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o 7# RUN: llvm-strip --strip-unneeded %t.o 8# RUN: ld.lld %t.o -o %t.exe -q 9# RUN: llvm-bolt %t.exe --relocs -o %t.null --print-only=foo --print-disasm \ 10# RUN: | FileCheck %s 11 12 .text 13 .globl _start 14 .type _start,@function 15_start: 16 .cfi_startproc 17 call foo 18 retq 19 .size _start, .-_start 20 .cfi_endproc 21 22 .globl foo 23 .type foo,@function 24foo: 25 .cfi_startproc 26 27 leaq foo-1(%rip), %rax 28## Check that the instruction references foo with a negative addend, 29## not the previous function with a positive addend (_start+X). 30# 31# CHECK: leaq foo-1(%rip), %rax 32 33 retq 34 .size foo, .-foo 35 .cfi_endproc 36