Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / partitions.s
blobf875a9cb4906c28b8d4ecccfd12837fbaf1c9642
1 // REQUIRES: aarch64, x86
2 // RUN: llvm-mc %s -o %t.o -filetype=obj --triple=x86_64-unknown-linux
3 // RUN: ld.lld %t.o -o %t --export-dynamic --gc-sections -z max-page-size=65536
4 // RUN: llvm-readelf -S -s %t | FileCheck %s
6 // RUN: llvm-mc %s -o %t.o -filetype=obj --triple=aarch64
7 // RUN: ld.lld %t.o -o %t --export-dynamic --gc-sections
8 // RUN: llvm-readelf -S -s %t | FileCheck %s
10 // This is basically lld/docs/partitions.dot in object file form.
11 // Test that the sections are correctly allocated to partitions.
12 // part1 and part2 should be aligned to a maximum page size boundary.
14 // CHECK: [[MAIN:[0-9]+]]] .text
15 // CHECK: part1 LLVM_PART_EHDR {{[0-9a-f]+}}0000 {{[0-9a-f]+}}0000
16 // CHECK: [[P1:[0-9]+]]] .text
17 // CHECK: part2 LLVM_PART_EHDR {{[0-9a-f]+}}0000 {{[0-9a-f]+}}0000
18 // CHECK: [[P2:[0-9]+]]] .text
20 // CHECK: Symbol table '.symtab'
21 // CHECK: [[MAIN]] f3
22 // CHECK: [[P1]] f4
23 // CHECK: [[MAIN]] f5
24 // CHECK: [[P2]] f6
25 // CHECK: [[P1]] f1
26 // CHECK: [[P2]] f2
27 // CHECK: [[MAIN]] _start
29 .section .llvm_sympart.f1,"",@llvm_sympart
30 .asciz "part1"
31 .quad f1
33 .section .llvm_sympart.f2,"",@llvm_sympart
34 .asciz "part2"
35 .quad f2
37 .section .text._start,"ax",@progbits
38 .globl _start
39 _start:
40 .quad f3
42 .section .text.f1,"ax",@progbits
43 .globl f1
44 f1:
45 .quad f3
46 .quad f4
47 .quad f5
49 .section .text.f2,"ax",@progbits
50 .globl f2
51 f2:
52 .quad f3
53 .quad f5
54 .quad f6
56 .section .text.f3,"ax",@progbits
57 f3:
58 ret
60 .section .text.f4,"ax",@progbits
61 f4:
62 ret
64 .section .text.f5,"ax",@progbits
65 f5:
66 ret
68 .section .text.f6,"ax",@progbits
69 f6:
70 ret