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: .text.warm
14 # CHECK-SYMS-WARM-SAME: chain.warm
15 # CHECK-SYMS-WARM: .text.cold
16 # CHECK-SYMS-WARM-SAME: dummy.cold
20 .type chain, @function
25 LLentry_LLchain_start
:
27 # FDATA: 1 chain #LLentry_LLchain_start# 1 chain #LLchain_start# 0 100
28 # FDATA: 1 chain #LLentry_LLchain_start# 1 chain #LLfast# 0 500
33 # FDATA: 1 chain #LLfast_LLexit# 1 chain #LLexit# 0 500
36 LLchain_start_LLchain1
:
38 # FDATA: 1 chain #LLchain_start_LLchain1# 1 chain #LLchain1# 0 99
39 # FDATA: 1 chain #LLchain_start_LLchain1# 1 chain #LLloop_entry# 0 1
45 xorl
%eax
, %eax
// Initialize result
46 movl $
1000000, %ecx
// Set loop counter to
a large value
47 LLloop_entry_LLloop_start
:
49 # FDATA: 1 chain #LLloop_entry_LLloop_start# 1 chain #LLloop_start# 0 1
51 addl $
1, %eax
// Increment result
52 subl $
1, %ecx
// Decrement loop counter
53 LLloop_start_LLloop_start
:
54 jg LLloop_start
// Jump if loop counter is greater than
0
55 # FDATA: 1 chain #LLloop_start_LLloop_start# 1 chain #LLloop_start# 0 1000000
56 # FDATA: 1 chain #LLloop_start_LLloop_start# 1 chain #LLchain1# 0 1
61 # FDATA: 1 chain #LLchain1_LLchain2# 1 chain #LLchain2# 0 100
66 # FDATA: 1 chain #LLchain2_LLchain3# 1 chain #LLchain3# 0 100
75 # FDATA: 1 chain #LLchain3_LLchain4# 1 chain #LLchain4# 0 100
84 # FDATA: 1 chain #LLchain4_LLexit# 1 chain #LLexit# 0 100
89 .size chain, LLchain_end-chain
93 .type dummy, @function
100 # FDATA: 1 dummy #dummy_dummy_block1# 1 dummy #dummy_block1# 0 0
101 # FDATA: 1 dummy #dummy_dummy_block1# 1 dummy #dummy_next# 0 100
105 dummy_next_dummy_exit
:
107 # FDATA: 1 dummy #dummy_next_dummy_exit# 1 dummy #dummy_exit# 0 100
114 dummy_block1_dummy_block2
:
116 # FDATA: 1 dummy #dummy_block1_dummy_block2# 1 dummy #dummy_block2# 0 0
123 dummy_block2_dummy_exit
:
125 # FDATA: 1 dummy #dummy_block2_dummy_exit# 1 dummy #dummy_exit# 0 0
131 .type main, @function
138 # FDATA: 1 main #LLmain_chain1# 1 chain 0 0 600
142 # FDATA: 1 main #LLmain_dummy# 1 dummy 0 0 100
147 .size main, .Lmain_end-main