Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / linkorder-script.s
blob6bf2887abb2a593015e83f86a18f15c855412ea2
1 // REQUIRES: x86
2 // RUN: llvm-mc --triple=x86_64 -filetype=obj %s -o %t.o
3 // RUN: echo "SECTIONS { \
4 // RUN: . = 0x80000000; \
5 // RUN: .linkorder : { *(.linkorder.*) } \
6 // RUN: .text : { *(.text) } \
7 // RUN: .text.1 0x80000200 : AT(0x1000) { *(.text.1) } \
8 // RUN: .text.2 0x80000100 : AT(0x2000) { *(.text.2) } \
9 // RUN: } " > %t.script
10 // RUN: ld.lld --script %t.script %t.o -o %t
11 // RUN: llvm-readobj -x .linkorder %t | FileCheck %s
13 /// When a linker script does not have monotonically increasing addresses
14 /// the SHF_LINK_ORDER sections should still be in monotonically increasing
15 /// order.
17 // CHECK: Hex dump of section '.linkorder':
18 // CHECK-NEXT: 0x80000000 0201
20 .section .text.1, "ax", %progbits
21 .global _start
22 _start:
23 nop
25 .section .text.2, "ax", %progbits
26 .byte 0
28 .section .linkorder.1, "ao", %progbits, .text.1
29 .byte 1
31 .section .linkorder.2, "ao", %progbits, .text.2
32 .byte 2