[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / cgprofile-txt2.s
blobbb9e78a4a2e9c2bb3da65083dc99e573a2821e03
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
4 # RUN: echo "A B 5" > %t.call_graph
5 # RUN: echo "B C 50" >> %t.call_graph
6 # RUN: echo "C D 40" >> %t.call_graph
7 # RUN: echo "D B 10" >> %t.call_graph
8 # RUN: echo "D E 1" >> %t.call_graph
9 # RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph --call-graph-profile-sort=hfsort -o %t2
10 # RUN: llvm-readobj --symbols %t2 | FileCheck %s --check-prefix=CHECKC3
11 # RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph --call-graph-profile-sort=cdsort -o %t2
12 # RUN: llvm-readobj --symbols %t2 | FileCheck %s --check-prefix=CHECKCDS
14 ## The expected order is [B, C, D, E, A]
15 # CHECKC3: Name: A
16 # CHECKC3-NEXT: Value: 0x201123
17 # CHECKC3: Name: B
18 # CHECKC3-NEXT: Value: 0x201120
19 # CHECKC3: Name: C
20 # CHECKC3-NEXT: Value: 0x201121
21 # CHECKC3: Name: D
22 # CHECKC3-NEXT: Value: 0x201122
23 # CHECKC3: Name: E
24 # CHECKC3-NEXT: Value: 0x201123
26 ## The expected order is [A, B, C, D, E]
27 # CHECKCDS: Name: A
28 # CHECKCDS-NEXT: Value: 0x201120
29 # CHECKCDS: Name: B
30 # CHECKCDS-NEXT: Value: 0x201121
31 # CHECKCDS: Name: C
32 # CHECKCDS-NEXT: Value: 0x201122
33 # CHECKCDS: Name: D
34 # CHECKCDS-NEXT: Value: 0x201123
35 # CHECKCDS: Name: E
36 # CHECKCDS-NEXT: Value: 0x201124
38 .section .text.A,"ax",@progbits
39 .globl A
41 nop
43 .section .text.B,"ax",@progbits
44 .globl B
46 nop
48 .section .text.C,"ax",@progbits
49 .globl C
51 nop
53 .section .text.D,"ax",@progbits
54 .globl D
56 nop
58 .section .text.E,"ax",@progbits
59 .globl E