Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / cgprofile-txt.s
blobc9194bbbc43cbe0284091ef63b66ebdedc4e5813
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
4 # RUN: ld.lld -e A %t -o %t2
5 # RUN: llvm-readobj --symbols %t2 | FileCheck %s --check-prefix=NOSORT
7 # RUN: echo "A B 10" > %t.call_graph
8 # RUN: echo "A B 10" >> %t.call_graph
9 # RUN: echo "Aa B 80" >> %t.call_graph
10 # RUN: echo "A C 40" >> %t.call_graph
11 # RUN: echo "B C 30" >> %t.call_graph
12 # RUN: echo "C D 90" >> %t.call_graph
13 # RUN: echo "PP TS 100" >> %t.call_graph
14 # RUN: echo "_init2 _init 24567837" >> %t.call_graph
15 # RUN: echo "TS QC 9001" >> %t.call_graph
16 # RUN: echo "TooManyPreds0 TooManyPreds 10" >> %t.call_graph
17 # RUN: echo "TooManyPreds1 TooManyPreds 10" >> %t.call_graph
18 # RUN: echo "TooManyPreds2 TooManyPreds 10" >> %t.call_graph
19 # RUN: echo "TooManyPreds3 TooManyPreds 10" >> %t.call_graph
20 # RUN: echo "TooManyPreds4 TooManyPreds 10" >> %t.call_graph
21 # RUN: echo "TooManyPreds5 TooManyPreds 10" >> %t.call_graph
22 # RUN: echo "TooManyPreds6 TooManyPreds 10" >> %t.call_graph
23 # RUN: echo "TooManyPreds7 TooManyPreds 10" >> %t.call_graph
24 # RUN: echo "TooManyPreds8 TooManyPreds 10" >> %t.call_graph
25 # RUN: echo "TooManyPreds9 TooManyPreds 10" >> %t.call_graph
26 # RUN: echo "TooManyPreds10 TooManyPreds 11" >> %t.call_graph
27 # RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph --call-graph-profile-sort=hfsort -o %t2
28 # RUN: llvm-readobj --symbols %t2 | FileCheck %s
29 ## --call-graph-profile-sort=hfsort is the default.
30 # RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph -o %t2b
31 # RUN: cmp %t2 %t2b
33 # RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph --call-graph-profile-sort=cdsort -o %t2
34 # RUN: llvm-readobj --symbols %t2 | FileCheck %s --check-prefix=CDSORT
36 # RUN: not ld.lld -e A %t --call-graph-ordering-file %t.call_graph --call-graph-profile-sort=sort \
37 # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=UNKNOWN
39 # UNKNOWN: error: unknown --call-graph-profile-sort= value: sort
41 .section .text.D,"ax",@progbits
43 retq
45 .section .text.C,"ax",@progbits
46 .globl C
48 retq
50 .section .text.B,"ax",@progbits
51 .globl B
53 retq
55 .section .text.A,"ax",@progbits
56 .globl A
58 Aa:
59 retq
61 .section .ponies,"ax",@progbits,unique,1
62 .globl TS
63 TS:
64 retq
66 .section .ponies,"ax",@progbits,unique,2
67 .globl PP
68 PP:
69 retq
71 .section .other,"ax",@progbits,unique,1
72 .globl QC
73 QC:
74 retq
76 .section .other,"ax",@progbits,unique,2
77 .globl GB
78 GB:
79 retq
81 .section .init,"ax",@progbits,unique,1
82 .globl _init
83 _init:
84 retq
86 .section .init,"ax",@progbits,unique,2
87 .globl _init2
88 _init2:
89 retq
91 .section .text.TooManyPreds,"ax",@progbits
92 TooManyPreds:
93 retq
94 retq
95 retq
96 retq
97 retq
98 retq
99 retq
100 retq
101 retq
102 retq
104 .section .text.TooManyPreds0,"ax",@progbits
105 TooManyPreds0:
106 retq
108 .section .text.TooManyPreds1,"ax",@progbits
109 TooManyPreds1:
110 retq
112 .section .text.TooManyPreds2,"ax",@progbits
113 TooManyPreds2:
114 retq
116 .section .text.TooManyPreds3,"ax",@progbits
117 TooManyPreds3:
118 retq
120 .section .text.TooManyPreds4,"ax",@progbits
121 TooManyPreds4:
122 retq
124 .section .text.TooManyPreds5,"ax",@progbits
125 TooManyPreds5:
126 retq
128 .section .text.TooManyPreds6,"ax",@progbits
129 TooManyPreds6:
130 retq
132 .section .text.TooManyPreds7,"ax",@progbits
133 TooManyPreds7:
134 retq
136 .section .text.TooManyPreds8,"ax",@progbits
137 TooManyPreds8:
138 retq
140 .section .text.TooManyPreds9,"ax",@progbits
141 TooManyPreds9:
142 retq
144 .section .text.TooManyPreds10,"ax",@progbits
145 TooManyPreds10:
146 retq
148 # CHECK: Name: D
149 # CHECK-NEXT: Value: 0x201123
150 # CHECK: Name: TooManyPreds
151 # CHECK-NEXT: Value: 0x201124
152 # CHECK: Name: TooManyPreds10
153 # CHECK-NEXT: Value: 0x201138
154 # CHECK: Name: C
155 # CHECK-NEXT: Value: 0x201122
156 # CHECK: Name: B
157 # CHECK-NEXT: Value: 0x201121
158 # CHECK: Name: A
159 # CHECK-NEXT: Value: 0x201120
160 # CHECK: Name: TS
161 # CHECK-NEXT: Value: 0x20113D
162 # CHECK: Name: PP
163 # CHECK-NEXT: Value: 0x20113C
164 # CHECK: Name: QC
165 # CHECK-NEXT: Value: 0x20113E
166 # CHECK: Name: GB
167 # CHECK-NEXT: Value: 0x20113F
168 # CHECK: Name: _init
169 # CHECK-NEXT: Value: 0x201140
170 # CHECK: Name: _init2
171 # CHECK-NEXT: Value: 0x201141
173 # CDSORT: Name: D
174 # CDSORT-NEXT: Value: 0x201123
175 # CDSORT: Name: TooManyPreds
176 # CDSORT-NEXT: Value: 0x20112F
177 # CDSORT: Name: TooManyPreds10
178 # CDSORT-NEXT: Value: 0x20112E
179 # CDSORT: Name: C
180 # CDSORT-NEXT: Value: 0x201122
181 # CDSORT: Name: B
182 # CDSORT-NEXT: Value: 0x201121
183 # CDSORT: Name: A
184 # CDSORT-NEXT: Value: 0x201120
185 # CDSORT: Name: TS
186 # CDSORT-NEXT: Value: 0x20113D
187 # CDSORT: Name: PP
188 # CDSORT-NEXT: Value: 0x20113C
189 # CDSORT: Name: QC
190 # CDSORT-NEXT: Value: 0x20113E
191 # CDSORT: Name: GB
192 # CDSORT-NEXT: Value: 0x20113F
193 # CDSORT: Name: _init
194 # CDSORT-NEXT: Value: 0x201140
195 # CDSORT: Name: _init2
196 # CDSORT-NEXT: Value: 0x201141
198 # NOSORT: Name: D
199 # NOSORT-NEXT: Value: 0x201120
200 # NOSORT: Name: TooManyPreds
201 # NOSORT-NEXT: Value: 0x201124
202 # NOSORT: Name: TooManyPreds10
203 # NOSORT-NEXT: Value: 0x201138
204 # NOSORT: Name: C
205 # NOSORT-NEXT: Value: 0x201121
206 # NOSORT: Name: B
207 # NOSORT-NEXT: Value: 0x201122
208 # NOSORT: Name: A
209 # NOSORT-NEXT: Value: 0x201123
210 # NOSORT: Name: TS
211 # NOSORT-NEXT: Value: 0x201139
212 # NOSORT: Name: PP
213 # NOSORT-NEXT: Value: 0x20113A
214 # NOSORT: Name: QC
215 # NOSORT-NEXT: Value: 0x20113B
216 # NOSORT: Name: GB
217 # NOSORT-NEXT: Value: 0x20113C
218 # NOSORT: Name: _init
219 # NOSORT-NEXT: Value: 0x20113D
220 # NOSORT: Name: _init2
221 # NOSORT-NEXT: Value: 0x20113E