Skip to content

Commit ab51077

Browse files
author
Alexander Yermolovich
committed
consolidate main/helper assembly under main. Next step move to test themselves
1 parent e867900 commit ab51077

27 files changed

+333
-261
lines changed

bolt/test/X86/Inputs/helperSafeICF.s

Lines changed: 0 additions & 39 deletions
This file was deleted.

bolt/test/X86/Inputs/helperSafeICFGlobalConstPtrNoPic.s

Lines changed: 0 additions & 24 deletions
This file was deleted.

bolt/test/X86/Inputs/helperSafeICFGlobalConstPtrNoPicExtFuncRef.s

Lines changed: 0 additions & 55 deletions
This file was deleted.

bolt/test/X86/Inputs/helperSafeICFGlobalConstPtrPic.s

Lines changed: 0 additions & 24 deletions
This file was deleted.

bolt/test/X86/Inputs/helperSafeICFGlobalConstPtrPicExtFuncRef.s

Lines changed: 0 additions & 55 deletions
This file was deleted.

bolt/test/X86/Inputs/helperSafeICFICPTest.s

Lines changed: 0 additions & 40 deletions
This file was deleted.

bolt/test/X86/Inputs/mainSafeICFGlobalConstPtrNoPic.s

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
# MY_PRINTF("val: %d", temp);
4040
# return temp;
4141
# }
42+
# clang++ helper.cpp -c -o
43+
# #define MY_CONST const
44+
# int FooVar = 1;
45+
# int BarVar = 2;
4246
# Manually modified to remove "extra" assembly.
4347
.text
4448
.file "main.cpp"
@@ -136,11 +140,27 @@ main: # @main
136140
.Lfunc_end6:
137141
.size main, .Lfunc_end6-main
138142
.cfi_endproc
143+
144+
.type FooVar,@object # @FooVar
145+
.data
146+
.globl FooVar
147+
.p2align 2, 0x0
148+
FooVar:
149+
.long 1 # 0x1
150+
.size FooVar, 4
151+
152+
.type BarVar,@object # @BarVar
153+
.globl BarVar
154+
.p2align 2, 0x0
155+
BarVar:
156+
.long 2 # 0x2
157+
.size BarVar, 4
139158
# -- End function
140159
.type .L.str,@object # @.str
141160
.section .rodata.str1.1,"aMS",@progbits,1
142161
.L.str:
143162
.asciz "val: %d\n"
144163
.size .L.str, 9
145164

165+
146166
.ident "clang version 20.0.0git"

bolt/test/X86/Inputs/mainSafeICFGlobalConstPtrNoPicExtFuncRef.s

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@
4949
# MY_PRINTF("val: %d", temp);
5050
# return temp;
5151
# }
52+
# clang++ helper.cpp -c -o
53+
# #define MY_CONST const
54+
# int FooVar = 1;
55+
# int BarVar = 2;
56+
# [[clang::noinline]]
57+
# MY_CONST int barAddHdlper(int a, int b) {
58+
# return a + b;
59+
# }
60+
#
61+
# MY_CONST int (*const funcGlobalBarMulExt)(int, int) = barAddHdlper;
62+
# MY_CONST int fooGlobalFuncHelper(int a, int b) {
63+
# return 5 + funcGlobalBarMulExt(a, b);
64+
# }
5265
# Manually modified to remove "extra" assembly.
5366
.text
5467
.file "main.cpp"
@@ -159,5 +172,45 @@ main: # @main
159172
.Lfunc_end8:
160173
.size main, .Lfunc_end8-main
161174
.cfi_endproc
175+
176+
177+
.globl _Z12barAddHdlperii # -- Begin function _Z12barAddHdlperii
178+
.p2align 4, 0x90
179+
.type _Z12barAddHdlperii,@function
180+
_Z12barAddHdlperii: # @_Z12barAddHdlperii
181+
.cfi_startproc
182+
addl -8(%rbp), %eax
183+
retq
184+
.Lfunc_end01:
185+
.size _Z12barAddHdlperii, .Lfunc_end01-_Z12barAddHdlperii
186+
.cfi_endproc
187+
# -- End function
188+
.globl _Z19fooGlobalFuncHelperii # -- Begin function _Z19fooGlobalFuncHelperii
189+
.p2align 4, 0x90
190+
.type _Z19fooGlobalFuncHelperii,@function
191+
_Z19fooGlobalFuncHelperii: # @_Z19fooGlobalFuncHelperii
192+
.cfi_startproc
193+
callq _Z12barAddHdlperii
194+
retq
195+
.Lfunc_end11:
196+
.size _Z19fooGlobalFuncHelperii, .Lfunc_end11-_Z19fooGlobalFuncHelperii
197+
.cfi_endproc
198+
# -- End function
199+
.type FooVar,@object # @FooVar
200+
.data
201+
.globl FooVar
202+
.p2align 2, 0x0
203+
FooVar:
204+
.long 1 # 0x1
205+
.size FooVar, 4
206+
207+
.type BarVar,@object # @BarVar
208+
.globl BarVar
209+
.p2align 2, 0x0
210+
BarVar:
211+
.long 2 # 0x2
212+
.size BarVar, 4
213+
214+
162215
# -- End function
163216
.ident "clang version 20.0.0git"

bolt/test/X86/Inputs/mainSafeICFGlobalConstPtrPic.s

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
# MY_PRINTF("val: %d", temp);
4040
# return temp;
4141
# }
42+
# clang++ helper.cpp -c -o
43+
# #define MY_CONST const
44+
# int FooVar = 1;
45+
# int BarVar = 2;
4246
# Manually modified to remove "extra" assembly.
4347
.text
4448
.file "main.cpp"
@@ -127,5 +131,20 @@ main: # @main
127131
.Lfunc_end6:
128132
.size main, .Lfunc_end6-main
129133
.cfi_endproc
134+
135+
.type FooVar,@object # @FooVar
136+
.data
137+
.globl FooVar
138+
.p2align 2, 0x0
139+
FooVar:
140+
.long 1 # 0x1
141+
.size FooVar, 4
142+
143+
.type BarVar,@object # @BarVar
144+
.globl BarVar
145+
.p2align 2, 0x0
146+
BarVar:
147+
.long 2 # 0x2
148+
.size BarVar, 4
130149
# -- End function
131150
.ident "clang version 20.0.0git"

0 commit comments

Comments
 (0)