[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / bolt / test / X86 / cdsplit-symbol-names.s
blobe2259276e2554c406223f9d209a52863fa184ab0
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
18 .text
19 .globl chain
20 .type chain, @function
21 chain:
22 pushq %rbp
23 movq %rsp, %rbp
24 cmpl $2, %edi
25 LLentry_LLchain_start:
26 jge 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
29 LLfast:
30 movl $5, %eax
31 LLfast_LLexit:
32 jmp LLexit
33 # FDATA: 1 chain #LLfast_LLexit# 1 chain #LLexit# 0 500
34 LLchain_start:
35 movl $10, %eax
36 LLchain_start_LLchain1:
37 jge 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
40 LLloop_entry:
41 addl $1, %eax
42 addl $1, %eax
43 addl $1, %eax
44 addl $1, %eax
45 xorl %eax, %eax // Initialize result
46 movl $1000000, %ecx // Set loop counter to a large value
47 LLloop_entry_LLloop_start:
48 jmp LLloop_start
49 # FDATA: 1 chain #LLloop_entry_LLloop_start# 1 chain #LLloop_start# 0 1
50 LLloop_start:
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
57 LLchain1:
58 addl $1, %eax
59 LLchain1_LLchain2:
60 jmp LLchain2
61 # FDATA: 1 chain #LLchain1_LLchain2# 1 chain #LLchain2# 0 100
62 LLchain2:
63 addl $1, %eax
64 LLchain2_LLchain3:
65 jmp LLchain3
66 # FDATA: 1 chain #LLchain2_LLchain3# 1 chain #LLchain3# 0 100
67 LLchain3:
68 addl $1, %eax
69 addl $1, %eax
70 addl $1, %eax
71 addl $1, %eax
72 addl $1, %eax
73 LLchain3_LLchain4:
74 jmp LLchain4
75 # FDATA: 1 chain #LLchain3_LLchain4# 1 chain #LLchain4# 0 100
76 LLchain4:
77 addl $1, %eax
78 addl $1, %eax
79 addl $1, %eax
80 addl $1, %eax
81 addl $1, %eax
82 LLchain4_LLexit:
83 jmp LLexit
84 # FDATA: 1 chain #LLchain4_LLexit# 1 chain #LLexit# 0 100
85 LLexit:
86 popq %rbp
87 ret
88 LLchain_end:
89 .size chain, LLchain_end-chain
91 .text
92 .globl dummy
93 .type dummy, @function
94 dummy:
95 pushq %rbp
96 movq %rsp, %rbp
97 cmpl $2, %edi
98 dummy_dummy_block1:
99 jg dummy_block1
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
102 dummy_next:
103 addl $1, %eax
104 addl $1, %eax
105 dummy_next_dummy_exit:
106 jmp dummy_exit
107 # FDATA: 1 dummy #dummy_next_dummy_exit# 1 dummy #dummy_exit# 0 100
108 dummy_block1:
109 addl $1, %eax
110 addl $1, %eax
111 addl $1, %eax
112 addl $1, %eax
113 addl $1, %eax
114 dummy_block1_dummy_block2:
115 jmp dummy_block2
116 # FDATA: 1 dummy #dummy_block1_dummy_block2# 1 dummy #dummy_block2# 0 0
117 dummy_block2:
118 addl $1, %eax
119 addl $1, %eax
120 addl $1, %eax
121 addl $1, %eax
122 addl $1, %eax
123 dummy_block2_dummy_exit:
124 jmp dummy_exit
125 # FDATA: 1 dummy #dummy_block2_dummy_exit# 1 dummy #dummy_exit# 0 0
126 dummy_exit:
127 popq %rbp
130 .globl main
131 .type main, @function
132 main:
133 pushq %rbp
134 movq %rsp, %rbp
135 movl $1, %edi
136 LLmain_chain1:
137 call chain
138 # FDATA: 1 main #LLmain_chain1# 1 chain 0 0 600
139 movl $4, %edi
140 LLmain_dummy:
141 call dummy
142 # FDATA: 1 main #LLmain_dummy# 1 dummy 0 0 100
143 xorl %eax, %eax
144 popq %rbp
145 retq
146 .Lmain_end:
147 .size main, .Lmain_end-main