Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / linkerscript / at-addr.s
blobdc9c988a03328e25e63cc434805066939fe3b823
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3 # RUN: echo "SECTIONS { . = 0x1000; \
4 # RUN: .aaa : AT(ADDR(.aaa) - 0x500) { *(.aaa) } \
5 # RUN: .bbb : AT(ADDR(.bbb) - 0x500) { *(.bbb) } \
6 # RUN: .ccc : AT(ADDR(.ccc) - 0x500) { *(.ccc) } \
7 # RUN: }" > %t.script
8 # RUN: ld.lld %t --script %t.script -o %t2
9 # RUN: llvm-readobj -l %t2 | FileCheck %s
11 # CHECK: Type: PT_LOAD
12 # CHECK-NEXT: Offset: 0x1000
13 # CHECK-NEXT: VirtualAddress: 0x1000
14 # CHECK-NEXT: PhysicalAddress: 0xB00
15 # CHECK: Type: PT_LOAD
16 # CHECK-NEXT: Offset: 0x1008
17 # CHECK-NEXT: VirtualAddress: 0x1008
18 # CHECK-NEXT: PhysicalAddress: 0xB08
19 # CHECK: Type: PT_LOAD
20 # CHECK-NEXT: Offset: 0x1010
21 # CHECK-NEXT: VirtualAddress: 0x1010
22 # CHECK-NEXT: PhysicalAddress: 0xB10
24 .global _start
25 _start:
26 nop
28 .section .aaa, "a"
29 .quad 0
31 .section .bbb, "a"
32 .quad 0
34 .section .ccc, "a"
35 .quad 0