2 # This test checks that CallGraphSort ignores edges that would form "bad"
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
6 # RUN: echo "A C 1" > %t.call_graph
7 # RUN: echo "E B 4" >> %t.call_graph
8 # RUN: echo "C D 2" >> %t.call_graph
9 # RUN: echo "B D 1" >> %t.call_graph
10 # RUN: echo "F G 6" >> %t.call_graph
11 # RUN: echo "G H 5" >> %t.call_graph
12 # RUN: echo "H I 4" >> %t.call_graph
13 # RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph --call-graph-profile-sort=hfsort -o %t2
14 # RUN: llvm-readobj --symbols %t2 | FileCheck %s
16 .section .text.A,"ax",@progbits
21 .section .text.D,"ax",@progbits
25 .section .text.E,"ax",@progbits
29 .section .text.C,"ax",@progbits
33 .section .text.B,"ax",@progbits
37 .section .text.F,"ax",@progbits
39 .fill (1024 * 1024) - 1, 1, 0
41 .section .text.G,"ax",@progbits
45 .section .text.H,"ax",@progbits
49 .section .text.I,"ax",@progbits
54 # CHECK-NEXT: Value: 0x201519
56 # CHECK-NEXT: Value: 0x201130
58 # CHECK-NEXT: Value: 0x20112F
60 # CHECK-NEXT: Value: 0x201131
62 # CHECK-NEXT: Value: 0x201901
64 # CHECK-NEXT: Value: 0x301900
66 # CHECK-NEXT: Value: 0x201120
68 # CHECK-NEXT: Value: 0x201121
70 # CHECK-NEXT: Value: 0x20112E