1 ## Test the correctness of section names and function symbol names post cdsplit.
2 ## Warm section should have name .text.warm and warm function fragments should
3 ## have symbol names ending in warm.
5 # RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o
6 # RUN: link_fdata %s %t.o %t.fdata
7 # RUN: llvm-strip --strip-unneeded %t.o
8 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
9 # RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=cdsplit \
10 # RUN: --call-scale=2 --data=%t.fdata --reorder-blocks=ext-tsp
11 # RUN: llvm-objdump --syms %t.bolt | FileCheck %s --check-prefix=CHECK-SYMS-WARM
13 # CHECK-SYMS-WARM: 0000000000000000 l df *ABS* 0000000000000000 bolt-pseudo.o
14 # CHECK-SYMS-WARM: .text.warm
15 # CHECK-SYMS-WARM-SAME: chain.warm
16 # CHECK-SYMS-WARM: .text.cold
17 # CHECK-SYMS-WARM-SAME: dummy.cold
21 .type chain, @function
26 LLentry_LLchain_start
:
28 # FDATA: 1 chain #LLentry_LLchain_start# 1 chain #LLchain_start# 0 100
29 # FDATA: 1 chain #LLentry_LLchain_start# 1 chain #LLfast# 0 500
34 # FDATA: 1 chain #LLfast_LLexit# 1 chain #LLexit# 0 500
37 LLchain_start_LLchain1
:
39 # FDATA: 1 chain #LLchain_start_LLchain1# 1 chain #LLchain1# 0 99
40 # FDATA: 1 chain #LLchain_start_LLchain1# 1 chain #LLloop_entry# 0 1
46 xorl
%eax
, %eax
// Initialize result
47 movl $
1000000, %ecx
// Set loop counter to
a large value
48 LLloop_entry_LLloop_start
:
50 # FDATA: 1 chain #LLloop_entry_LLloop_start# 1 chain #LLloop_start# 0 1
52 addl $
1, %eax
// Increment result
53 subl $
1, %ecx
// Decrement loop counter
54 LLloop_start_LLloop_start
:
55 jg LLloop_start
// Jump if loop counter is greater than
0
56 # FDATA: 1 chain #LLloop_start_LLloop_start# 1 chain #LLloop_start# 0 1000000
57 # FDATA: 1 chain #LLloop_start_LLloop_start# 1 chain #LLchain1# 0 1
62 # FDATA: 1 chain #LLchain1_LLchain2# 1 chain #LLchain2# 0 100
67 # FDATA: 1 chain #LLchain2_LLchain3# 1 chain #LLchain3# 0 100
76 # FDATA: 1 chain #LLchain3_LLchain4# 1 chain #LLchain4# 0 100
85 # FDATA: 1 chain #LLchain4_LLexit# 1 chain #LLexit# 0 100
90 .size chain, LLchain_end-chain
94 .type dummy, @function
101 # FDATA: 1 dummy #dummy_dummy_block1# 1 dummy #dummy_block1# 0 0
102 # FDATA: 1 dummy #dummy_dummy_block1# 1 dummy #dummy_next# 0 100
106 dummy_next_dummy_exit
:
108 # FDATA: 1 dummy #dummy_next_dummy_exit# 1 dummy #dummy_exit# 0 100
115 dummy_block1_dummy_block2
:
117 # FDATA: 1 dummy #dummy_block1_dummy_block2# 1 dummy #dummy_block2# 0 0
124 dummy_block2_dummy_exit
:
126 # FDATA: 1 dummy #dummy_block2_dummy_exit# 1 dummy #dummy_exit# 0 0
132 .type main, @function
139 # FDATA: 1 main #LLmain_chain1# 1 chain 0 0 600
143 # FDATA: 1 main #LLmain_dummy# 1 dummy 0 0 100
148 .size main, .Lmain_end-main