Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / pre_init_fini_array_missing.s
blob22cf5fe9e2bea29278ff2b5cb411d56435d2728b
1 // REQUIRES: x86
2 // RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3 // RUN: ld.lld %t.o -o %t
4 // RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
5 // RUN: ld.lld -pie %t.o -o %t2
6 // RUN: llvm-objdump -d --no-show-raw-insn %t2 | FileCheck --check-prefix=PIE %s
8 .globl _start
9 _start:
10 call __preinit_array_start
11 call __preinit_array_end
12 call __init_array_start
13 call __init_array_end
14 call __fini_array_start
15 call __fini_array_end
17 // With no .init_array section the symbols resolve to .text.
18 // 0x201120 - (0x201120 + 5) = -5
19 // 0x201120 - (0x201125 + 5) = -10
20 // ...
22 // CHECK: Disassembly of section .text:
23 // CHECK-EMPTY:
24 // CHECK-NEXT: <_start>:
25 // CHECK-NEXT: 201120: callq 0x201120
26 // CHECK-NEXT: callq 0x201120
27 // CHECK-NEXT: callq 0x201120
28 // CHECK-NEXT: callq 0x201120
29 // CHECK-NEXT: callq 0x201120
30 // CHECK-NEXT: callq 0x201120
32 // In position-independent binaries, they resolve to .text too.
34 // PIE: Disassembly of section .text:
35 // PIE-EMPTY:
36 // PIE-NEXT: <_start>:
37 // PIE-NEXT: 1210: callq 0x1210
38 // PIE-NEXT: callq 0x1210
39 // PIE-NEXT: callq 0x1210
40 // PIE-NEXT: callq 0x1210
41 // PIE-NEXT: callq 0x1210
42 // PIE-NEXT: callq 0x1210