Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / x86-64-reloc-size.s
blob0eecbc60e4e99d1163d59416c9ad7cd89f339792
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3 # RUN: ld.lld %t.o -o %t
4 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=NORELOC %s
5 # RUN: llvm-readelf -x .data -x nonalloc %t | FileCheck --check-prefix=DATA %s
6 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck --check-prefix=DISASM %s
8 # RUN: ld.lld -shared %t.o -o %t.so
9 # RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=RELOC2 %s
10 # RUN: llvm-readelf -x .data %t.so | FileCheck --check-prefix=DATA2 %s
11 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck --check-prefix=DISASM2 %s
13 # NORELOC: Relocations [
14 # NORELOC-NEXT: ]
16 # DATA: section '.data':
17 # DATA-NEXT: 0x002031ac 00000000 00000000 00000000 00000000
18 # DATA-NEXT: 0x002031bc 00000000 00000000 00001900 00000000
19 # DATA-NEXT: 0x002031cc 00001b00 00000000 00001900 00000000
20 # DATA-NEXT: 0x002031dc 00001b00 00000000 0000
22 # DATA: section 'nonalloc':
23 # DATA-NEXT: 0x00000000 1a000000 00000000
25 # DISASM: <_start>:
26 # DISASM-NEXT: movl 25, %eax
27 # DISASM-NEXT: movl 27, %eax
28 # DISASM-NEXT: movl 25, %eax
29 # DISASM-NEXT: movl 27, %eax
31 # RELOC2: Relocations [
32 # RELOC2-NEXT: Section ({{.*}}) .rela.dyn {
33 # RELOC2-NEXT: 0x2333 R_X86_64_SIZE32 foo 0xFFFFFFFFFFFFFFFF
34 # RELOC2-NEXT: 0x233A R_X86_64_SIZE32 foo 0x1
35 # RELOC2-NEXT: 0x440A R_X86_64_SIZE64 foo 0xFFFFFFFFFFFFFFFF
36 # RELOC2-NEXT: 0x4412 R_X86_64_SIZE64 foo 0x1
37 # RELOC2-NEXT: }
38 # RELOC2-NEXT: ]
40 # DATA2: section '.data':
41 # DATA2-NEXT: 00000000 00000000 00000000 00000000
42 # DATA2-NEXT: 00000000 00000000 00000000 00000000
43 # DATA2-NEXT: 00000000 00000000 00001900 00000000
44 # DATA2-NEXT: 00001b00 00000000 0000
46 # DISASM2: <_start>:
47 # DISASM2-NEXT: movl 0, %eax
48 # DISASM2-NEXT: movl 0, %eax
49 # DISASM2-NEXT: movl 25, %eax
50 # DISASM2-NEXT: movl 27, %eax
52 .data
53 .global foo, foohidden
54 .hidden foohidden
55 .type foo,%object
56 .size foo,26
57 .type foohidden,%object
58 .size foohidden,26
59 foo:
60 foohidden:
61 .zero 26
63 // R_X86_64_SIZE64:
64 .quad foo@SIZE-1
65 .quad foo@SIZE+1
66 .quad foohidden@SIZE-1
67 .quad foohidden@SIZE+1
69 .section test,"axw"
70 .globl _start
71 _start:
72 // R_X86_64_SIZE32:
73 movl foo@SIZE-1,%eax
74 movl foo@SIZE+1,%eax
75 movl foohidden@SIZE-1,%eax
76 movl foohidden@SIZE+1,%eax
78 .section nonalloc
79 .quad foo@SIZE