1 # RUN: llvm-mc -triple=i686-windows-msvc -filetype=obj < %s | llvm-readobj --codeview | FileCheck %s
3 # Test for .cv_fpo_stackalign. We should generate FPO data that restores CSRs
4 # at each instruction, and in the last FrameData we should use the '@'
5 # alignment operator to define $T0, the vframe value.
7 # Based on this C code:
8 # void usevals(int, int, double*);
9 # int realign_with_csrs() {
12 # double __declspec(align(8)) force_alignment = 0.42;
13 # usevals(a, b, &force_alignment);
18 # CHECK: SubSectionType: Symbols (0xF1)
19 # CHECK: Compile3Sym {
20 # CHECK: Kind: S_COMPILE3 (0x113C)
24 # CHECK: SubSectionType: FrameData (0xF5)
27 # CHECK: $T0 .raSearch =
29 # CHECK: $esp $T0 4 + =
34 # CHECK: $T0 .raSearch =
36 # CHECK: $esp $T0 4 + =
37 # CHECK: $ebp $T0 4 - ^ =
42 # CHECK: $T0 $ebp 4 + =
44 # CHECK: $esp $T0 4 + =
45 # CHECK: $ebp $T0 4 - ^ =
50 # CHECK: $T0 $ebp 4 + =
52 # CHECK: $esp $T0 4 + =
53 # CHECK: $ebp $T0 4 - ^ =
54 # CHECK: $edi $T0 8 - ^ =
59 # CHECK: $T0 $ebp 4 + =
61 # CHECK: $esp $T0 4 + =
62 # CHECK: $ebp $T0 4 - ^ =
63 # CHECK: $edi $T0 8 - ^ =
64 # CHECK: $esi $T0 12 - ^ =
69 # CHECK: $T1 $ebp 4 + =
70 # CHECK: $T0 $T1 12 - 8 @ =
72 # CHECK: $esp $T1 4 + =
73 # CHECK: $ebp $T1 4 - ^ =
74 # CHECK: $edi $T1 8 - ^ =
75 # CHECK: $esi $T1 12 - ^ =
80 # CHECK: SubSectionType: Symbols (0xF1)
83 # CHECK: SubSectionType: FileChecksums (0xF4)
86 # CHECK: SubSectionType: StringTable (0xF3)
90 .def _realign_with_csrs; .scl 2; .type 32; .endef
91 .globl _realign_with_csrs # -- Begin function realign_with_csrs
92 _realign_with_csrs
: # @realign_with_csrs
95 .cv_file 1 "C:\\src\\llvm-project\\build\\t.c" "2A4F9B6BBBF7845521201755D1B14ACC" 1
96 .cv_loc 0 1 4 0 # t.c:4:0
97 .cv_fpo_proc _realign_with_csrs 0
102 .cv_fpo_setframe %ebp
113 .cv_loc 0 1 5 0 # t.c:5:0
116 .cv_loc 0 1 6 0 # t.c:6:0
120 .cv_loc 0 1 7 0 # t.c:7:0
121 movl $
1071309127, 4(%esp
) # imm = 0x3FDAE147
122 movl $
-1374389535, (%esp
) # imm = 0xAE147AE1
123 .cv_loc 0 1 8 0 # t.c:8:0
129 .cv_loc 0 1 9 0 # t.c:9:0
141 .section .debug$S,"dr"
143 .long 4 # Debug section magic
145 .long Ltmp3-Ltmp2 # Subsection size
147 .short Ltmp5-Ltmp4 # Record length
149 .short 4412 # Record kind: S_COMPILE3
150 .long 0 # Flags and language
152 .short 8 # Frontend version
156 .short 8000 # Backend version
160 .asciz "clang version 8.0.0 " # Null-terminated compiler version string
164 .cv_fpo_data _realign_with_csrs
165 .long 241 # Symbol subsection for realign_with_csrs
166 .long Ltmp7-Ltmp6 # Subsection size
168 .short Ltmp9-Ltmp8 # Record length
170 .short 4423 # Record kind: S_GPROC32_ID
174 .long Lfunc_end0-_realign_with_csrs # Code size
175 .long 0 # Offset after prologue
176 .long 0 # Offset before epilogue
177 .long 0 # Function type index
178 .secrel32 _realign_with_csrs # Function section relative address
179 .secidx _realign_with_csrs # Function section index
181 .asciz "realign_with_csrs" # Function name
183 .short Ltmp11-Ltmp10 # Record length
185 .short 4114 # Record kind: S_FRAMEPROC
188 .long 0 # Offset of padding
189 .long 8 # Bytes of callee saved registers
190 .long 0 # Exception handler offset
191 .short 0 # Exception handler section
192 .long 1196032 # Flags (defines frame register)
194 .short 2 # Record length
195 .short 4431 # Record kind: S_PROC_ID_END
198 .cv_filechecksums # File index to string table offset subsection
199 .cv_stringtable # String table