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