[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / cgprofile-obj.s
blobf56f3bcbf0c3c5e92c11e83b8c692f0cb17450e9
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 --no-call-graph-profile-sort -e A %t.o -o %t
7 # RUN: llvm-nm --no-sort %t | FileCheck %s --check-prefix=NO-CG
9 .section .text.D,"ax",@progbits
11 retq
13 .section .text.C,"ax",@progbits
14 .globl C
16 retq
18 .section .text.B,"ax",@progbits
19 .globl B
21 retq
23 .section .text.A,"ax",@progbits
24 .globl A
26 Aa:
27 retq
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
36 # CHECK: 0000000000201123 t D
37 # CHECK: 0000000000201122 T C
38 # CHECK: 0000000000201121 T B
39 # CHECK: 0000000000201120 T A
41 # NO-CG: 0000000000201120 t D
42 # NO-CG: 0000000000201121 T C
43 # NO-CG: 0000000000201122 T B
44 # NO-CG: 0000000000201123 T A