1# REQUIRES: x86
2
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 --no-call-graph-profile-sort -e A %t.o -o %t
7# RUN: llvm-nm --no-sort %t | FileCheck %s --check-prefix=NO-CG
8
9    .section    .text.D,"ax",@progbits
10D:
11    retq
12
13    .section    .text.C,"ax",@progbits
14    .globl  C
15C:
16    retq
17
18    .section    .text.B,"ax",@progbits
19    .globl  B
20B:
21    retq
22
23    .section    .text.A,"ax",@progbits
24    .globl  A
25A:
26Aa:
27    retq
28
29    .cg_profile A, B, 10
30    .cg_profile A, B, 10
31    .cg_profile Aa, B, 80
32    .cg_profile A, C, 40
33    .cg_profile B, C, 30
34    .cg_profile C, D, 90
35
36# CHECK: 0000000000201123 t D
37# CHECK: 0000000000201122 T C
38# CHECK: 0000000000201121 T B
39# CHECK: 0000000000201120 T A
40
41# NO-CG: 0000000000201120 t D
42# NO-CG: 0000000000201121 T C
43# NO-CG: 0000000000201122 T B
44# NO-CG: 0000000000201123 T A
45