2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: x86
|
2018-04-18 07:30:05 +08:00
|
|
|
# This test checks that CallGraphSort ignores edges that would form "bad"
|
|
|
|
# clusters.
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
|
|
|
# RUN: echo "A C 1" > %t.call_graph
|
|
|
|
# RUN: echo "E B 4" >> %t.call_graph
|
|
|
|
# RUN: echo "C D 2" >> %t.call_graph
|
|
|
|
# RUN: echo "B D 1" >> %t.call_graph
|
|
|
|
# RUN: echo "F G 6" >> %t.call_graph
|
|
|
|
# RUN: echo "G H 5" >> %t.call_graph
|
|
|
|
# RUN: echo "H I 4" >> %t.call_graph
|
|
|
|
# RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph -o %t2
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --symbols %t2 | FileCheck %s
|
2018-04-18 07:30:05 +08:00
|
|
|
|
|
|
|
.section .text.A,"ax",@progbits
|
|
|
|
.globl A
|
|
|
|
A:
|
|
|
|
retq
|
|
|
|
|
|
|
|
.section .text.D,"ax",@progbits
|
|
|
|
D:
|
|
|
|
.fill 1000, 1, 0
|
|
|
|
|
|
|
|
.section .text.E,"ax",@progbits
|
|
|
|
E:
|
|
|
|
retq
|
|
|
|
|
|
|
|
.section .text.C,"ax",@progbits
|
|
|
|
C:
|
|
|
|
retq
|
|
|
|
|
|
|
|
.section .text.B,"ax",@progbits
|
|
|
|
B:
|
|
|
|
.fill 1000, 1, 0
|
|
|
|
|
|
|
|
.section .text.F,"ax",@progbits
|
|
|
|
F:
|
|
|
|
.fill (1024 * 1024) - 1, 1, 0
|
|
|
|
|
|
|
|
.section .text.G,"ax",@progbits
|
|
|
|
G:
|
|
|
|
retq
|
|
|
|
|
|
|
|
.section .text.H,"ax",@progbits
|
|
|
|
H:
|
|
|
|
retq
|
|
|
|
|
|
|
|
.section .text.I,"ax",@progbits
|
|
|
|
I:
|
|
|
|
.fill 13, 1, 0
|
|
|
|
|
|
|
|
# CHECK: Name: D
|
2019-09-16 15:05:34 +08:00
|
|
|
# CHECK-NEXT: Value: 0x201519
|
2018-04-18 07:30:05 +08:00
|
|
|
# CHECK: Name: E
|
2019-09-16 15:05:34 +08:00
|
|
|
# CHECK-NEXT: Value: 0x201130
|
2021-02-08 07:47:10 +08:00
|
|
|
# CHECK: Name: C
|
|
|
|
# CHECK-NEXT: Value: 0x20112F
|
|
|
|
# CHECK: Name: B
|
|
|
|
# CHECK-NEXT: Value: 0x201131
|
2018-04-18 07:30:05 +08:00
|
|
|
# CHECK: Name: F
|
2019-09-16 15:05:34 +08:00
|
|
|
# CHECK-NEXT: Value: 0x201901
|
2018-04-18 07:30:05 +08:00
|
|
|
# CHECK: Name: G
|
2019-09-16 15:05:34 +08:00
|
|
|
# CHECK-NEXT: Value: 0x301900
|
2018-04-18 07:30:05 +08:00
|
|
|
# CHECK: Name: H
|
2019-09-16 15:05:34 +08:00
|
|
|
# CHECK-NEXT: Value: 0x201120
|
2018-04-18 07:30:05 +08:00
|
|
|
# CHECK: Name: I
|
2019-09-16 15:05:34 +08:00
|
|
|
# CHECK-NEXT: Value: 0x201121
|
2018-04-18 07:30:05 +08:00
|
|
|
# CHECK: Name: A
|
2019-09-16 15:05:34 +08:00
|
|
|
# CHECK-NEXT: Value: 0x20112E
|