Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / double-rel.s
blob7de842d9dd3187ba9374345bc761a01fdeae0149
1 ## Check that BOLT can correctly use relocations to symbolize instruction
2 ## operands when an instruction can have up to two relocations associated
3 ## with it.
5 # REQUIRES: system-linux
7 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
8 # RUN: ld.lld %t.o -o %t.exe -q --Tdata=0x80000
9 # RUN: llvm-bolt %t.exe --relocs -o /dev/null --print-only=_start --print-disasm \
10 # RUN: | FileCheck %s --check-prefix=CHECK-BOLT
11 # RUN: llvm-objdump -d --print-imm-hex %t.exe \
12 # RUN: | FileCheck %s --check-prefix=CHECK-OBJDUMP
14 .data
15 .globl VAR
16 VAR:
17 .quad
19 .text
20 .globl _start
21 .type _start,@function
22 _start:
23 .cfi_startproc
25 ## VAR value is 0x80000. Using relocations, llvm-bolt should correctly
26 ## symbolize the instruction operands.
28 movq $0x80000, 0x80000
29 # CHECK-BOLT: movq $0x80000, 0x80000
30 # CHECK-OBJDUMP: movq $0x80000, 0x80000
32 movq $VAR, 0x80000
33 # CHECK-BOLT: movq $VAR, 0x80000
34 # CHECK-OBJDUMP: movq $0x80000, 0x80000
36 movq $0x80000, VAR
37 # CHECK-BOLT-NEXT: movq $0x80000, VAR
38 # CHECK-OBJDUMP-NEXT: movq $0x80000, 0x80000
40 movq $VAR, VAR
41 # CHECK-BOLT-NEXT: movq $VAR, VAR
42 # CHECK-OBJDUMP-NEXT: movq $0x80000, 0x80000
44 retq
45 .size _start, .-_start
46 .cfi_endproc