Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / cgprofile-obj.s
blob0848adc5e4279a7edbb8fdc3730f104ed711819b
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
4 # RUN: ld.lld -e A %t.o -o %t
5 # RUN: llvm-nm --no-sort %t | FileCheck %s
6 # RUN: ld.lld --call-graph-profile-sort=none -e A %t.o -o %t
7 # RUN: llvm-nm --no-sort %t | FileCheck %s --check-prefix=NO-CG
8 ## --no-call-graph-profile-sort is an alias for --call-graph-profile-sort=none.
9 # RUN: ld.lld --no-call-graph-profile-sort -e A %t.o -o %t1
10 # RUN: cmp %t %t1
12 .section .text.D,"ax",@progbits
14 retq
16 .section .text.C,"ax",@progbits
17 .globl C
19 retq
21 .section .text.B,"ax",@progbits
22 .globl B
24 retq
26 .section .text.A,"ax",@progbits
27 .globl A
29 Aa:
30 retq
32 .cg_profile A, B, 10
33 .cg_profile A, B, 10
34 .cg_profile Aa, B, 80
35 .cg_profile A, C, 40
36 .cg_profile B, C, 30
37 .cg_profile C, D, 90
39 # CHECK: 0000000000201123 t D
40 # CHECK: 0000000000201122 T C
41 # CHECK: 0000000000201121 T B
42 # CHECK: 0000000000201120 T A
44 # NO-CG: 0000000000201120 t D
45 # NO-CG: 0000000000201121 T C
46 # NO-CG: 0000000000201122 T B
47 # NO-CG: 0000000000201123 T A