brintos

brintos / llvm-project-archived public Read only

0
0
Text · 799 B · 054d177 Raw
36 lines · plain
1## Check that BOLT correctly recognizes pc-relative function pointer2## reference with an addend.3 4# REQUIRES: system-linux5 6# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o7# RUN: llvm-strip --strip-unneeded %t.o8# RUN: ld.lld %t.o -o %t.exe -q9# RUN: llvm-bolt %t.exe --relocs -o %t.null --print-only=foo --print-disasm \10# RUN:   | FileCheck %s11 12  .text13  .globl _start14  .type _start,@function15_start:16  .cfi_startproc17  call foo18  retq19  .size _start, .-_start20  .cfi_endproc21 22  .globl  foo23  .type foo,@function24foo:25  .cfi_startproc26 27  leaq  foo-1(%rip), %rax28## 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), %rax32 33  retq34  .size foo, .-foo35  .cfi_endproc36