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