cv-fpo-csrs.s
4.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# RUN: llvm-mc -filetype=asm < %s -triple i686-windows-msvc | FileCheck %s --check-prefix=ASM
# RUN: llvm-mc -filetype=obj < %s -triple i686-windows-msvc | llvm-readobj --codeview - | FileCheck %s --check-prefix=OBJ
.globl _foo
_foo:
.cv_fpo_proc _foo 4
pushl %ebp
.cv_fpo_pushreg ebp # Test without %
pushl %ebx
.cv_fpo_pushreg %ebx
pushl %edi
.cv_fpo_pushreg %edi
pushl %esi
.cv_fpo_pushreg esi
subl $20, %esp
.cv_fpo_stackalloc 20
.cv_fpo_endprologue
# ASM: .cv_fpo_proc _foo 4
# ASM: pushl %ebp
# ASM: .cv_fpo_pushreg %ebp
# ASM: pushl %ebx
# ASM: .cv_fpo_pushreg %ebx
# ASM: pushl %edi
# ASM: .cv_fpo_pushreg %edi
# ASM: pushl %esi
# ASM: .cv_fpo_pushreg %esi
# ASM: subl $20, %esp
# ASM: .cv_fpo_stackalloc 20
# ASM: .cv_fpo_endprologue
# Clobbers
xorl %ebp, %ebp
xorl %ebx, %ebx
xorl %edi, %edi
xorl %esi, %esi
# Use that stack memory
leal 4(%esp), %eax
movl %eax, (%esp)
calll _bar
# ASM: calll _bar
# Epilogue
# FIXME: Get FPO data for this once we get it for DWARF.
addl $20, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
retl
.cv_fpo_endproc
# ASM: .cv_fpo_endproc
.section .debug$S,"dr"
.p2align 2
.long 4 # Debug section magic
.cv_fpo_data _foo
.cv_stringtable
# ASM: .cv_fpo_data
# OBJ: Subsection [
# OBJ-NEXT: SubSectionType: FrameData (0xF5)
# OBJ-NEXT: SubSectionSize: 0xC4
# OBJ-NEXT: LinkageName: _foo
# OBJ-NEXT: FrameData {
# OBJ-NEXT: RvaStart: 0x0
# OBJ-NEXT: CodeSize: 0x23
# OBJ-NEXT: LocalSize: 0x0
# OBJ-NEXT: ParamsSize: 0x4
# OBJ-NEXT: MaxStackSize: 0x0
# OBJ-NEXT: PrologSize: 0x7
# OBJ-NEXT: SavedRegsSize: 0x0
# OBJ-NEXT: Flags [ (0x4)
# OBJ-NEXT: IsFunctionStart (0x4)
# OBJ-NEXT: ]
# OBJ-NEXT: FrameFunc [
# OBJ-NEXT: $T0 .raSearch =
# OBJ-NEXT: $eip $T0 ^ =
# OBJ-NEXT: $esp $T0 4 + =
# OBJ-NEXT: ]
# OBJ-NEXT: }
# OBJ-NEXT: FrameData {
# OBJ-NEXT: RvaStart: 0x1
# OBJ-NEXT: CodeSize: 0x22
# OBJ-NEXT: LocalSize: 0x0
# OBJ-NEXT: ParamsSize: 0x4
# OBJ-NEXT: MaxStackSize: 0x0
# OBJ-NEXT: PrologSize: 0x6
# OBJ-NEXT: SavedRegsSize: 0x4
# OBJ-NEXT: Flags [ (0x0)
# OBJ-NEXT: ]
# OBJ-NEXT: FrameFunc [
# OBJ-NEXT: $T0 .raSearch =
# OBJ-NEXT: $eip $T0 ^ =
# OBJ-NEXT: $esp $T0 4 + =
# OBJ-NEXT: $ebp $T0 4 - ^ =
# OBJ-NEXT: ]
# OBJ-NEXT: }
# OBJ-NEXT: FrameData {
# OBJ-NEXT: RvaStart: 0x2
# OBJ-NEXT: CodeSize: 0x21
# OBJ-NEXT: LocalSize: 0x0
# OBJ-NEXT: ParamsSize: 0x4
# OBJ-NEXT: MaxStackSize: 0x0
# OBJ-NEXT: PrologSize: 0x5
# OBJ-NEXT: SavedRegsSize: 0x8
# OBJ-NEXT: Flags [ (0x0)
# OBJ-NEXT: ]
# OBJ-NEXT: FrameFunc [
# OBJ-NEXT: $T0 .raSearch =
# OBJ-NEXT: $eip $T0 ^ =
# OBJ-NEXT: $esp $T0 4 + =
# OBJ-NEXT: $ebp $T0 4 - ^ =
# OBJ-NEXT: $ebx $T0 8 - ^ =
# OBJ-NEXT: ]
# OBJ-NEXT: }
# OBJ-NEXT: FrameData {
# OBJ-NEXT: RvaStart: 0x3
# OBJ-NEXT: CodeSize: 0x20
# OBJ-NEXT: LocalSize: 0x0
# OBJ-NEXT: ParamsSize: 0x4
# OBJ-NEXT: MaxStackSize: 0x0
# OBJ-NEXT: PrologSize: 0x4
# OBJ-NEXT: SavedRegsSize: 0xC
# OBJ-NEXT: Flags [ (0x0)
# OBJ-NEXT: ]
# OBJ-NEXT: FrameFunc [
# OBJ-NEXT: $T0 .raSearch =
# OBJ-NEXT: $eip $T0 ^ =
# OBJ-NEXT: $esp $T0 4 + =
# OBJ-NEXT: $ebp $T0 4 - ^ =
# OBJ-NEXT: $ebx $T0 8 - ^ =
# OBJ-NEXT: $edi $T0 12 - ^ =
# OBJ-NEXT: ]
# OBJ-NEXT: }
# OBJ-NEXT: FrameData {
# OBJ-NEXT: RvaStart: 0x4
# OBJ-NEXT: CodeSize: 0x1F
# OBJ-NEXT: LocalSize: 0x0
# OBJ-NEXT: ParamsSize: 0x4
# OBJ-NEXT: MaxStackSize: 0x0
# OBJ-NEXT: PrologSize: 0x3
# OBJ-NEXT: SavedRegsSize: 0x10
# OBJ-NEXT: Flags [ (0x0)
# OBJ-NEXT: ]
# OBJ-NEXT: FrameFunc [
# OBJ-NEXT: $T0 .raSearch =
# OBJ-NEXT: $eip $T0 ^ =
# OBJ-NEXT: $esp $T0 4 + =
# OBJ-NEXT: $ebp $T0 4 - ^ =
# OBJ-NEXT: $ebx $T0 8 - ^ =
# OBJ-NEXT: $edi $T0 12 - ^ =
# OBJ-NEXT: $esi $T0 16 - ^ =
# OBJ-NEXT: ]
# OBJ-NEXT: }
# OBJ-NEXT: FrameData {
# OBJ-NEXT: RvaStart: 0x7
# OBJ-NEXT: CodeSize: 0x1C
# OBJ-NEXT: LocalSize: 0x14
# OBJ-NEXT: ParamsSize: 0x4
# OBJ-NEXT: MaxStackSize: 0x0
# OBJ-NEXT: PrologSize: 0x0
# OBJ-NEXT: SavedRegsSize: 0x10
# OBJ-NEXT: Flags [ (0x0)
# OBJ-NEXT: ]
# OBJ-NEXT: FrameFunc [
# OBJ-NEXT: $T0 .raSearch =
# OBJ-NEXT: $eip $T0 ^ =
# OBJ-NEXT: $esp $T0 4 + =
# OBJ-NEXT: $ebp $T0 4 - ^ =
# OBJ-NEXT: $ebx $T0 8 - ^ =
# OBJ-NEXT: $edi $T0 12 - ^ =
# OBJ-NEXT: $esi $T0 16 - ^ =
# OBJ-NEXT: ]
# OBJ-NEXT: }
# OBJ-NOT: FrameData