brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · f061515 Raw
47 lines · plain
1## Check that BOLT can correctly use relocations to symbolize instruction2## operands when an instruction can have up to two relocations associated3## with it.4 5# REQUIRES: system-linux6 7# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o8# RUN: ld.lld %t.o -o %t.exe -q --image-base=0x70000 --Tdata=0x800009# RUN: llvm-bolt %t.exe --relocs -o %t.null --print-only=_start --print-disasm \10# RUN:   | FileCheck %s --check-prefix=CHECK-BOLT11# RUN: llvm-objdump -d --print-imm-hex %t.exe \12# RUN:   | FileCheck %s --check-prefix=CHECK-OBJDUMP13 14  .data15  .globl VAR16VAR:17  .quad18 19  .text20  .globl _start21  .type _start,@function22_start:23  .cfi_startproc24 25## VAR value is 0x80000. Using relocations, llvm-bolt should correctly26## symbolize the instruction operands.27 28  movq $0x80000, 0x8000029# CHECK-BOLT:    movq $0x80000, 0x8000030# CHECK-OBJDUMP: movq $0x80000, 0x8000031 32  movq $VAR, 0x8000033# CHECK-BOLT:    movq $VAR, 0x8000034# CHECK-OBJDUMP: movq $0x80000, 0x8000035 36  movq $0x80000, VAR37# CHECK-BOLT-NEXT:    movq $0x80000, VAR38# CHECK-OBJDUMP-NEXT: movq $0x80000, 0x8000039 40  movq $VAR, VAR41# CHECK-BOLT-NEXT:    movq $VAR, VAR42# CHECK-OBJDUMP-NEXT: movq $0x80000, 0x8000043 44  retq45  .size _start, .-_start46  .cfi_endproc47