1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/MC/COFF/cv-fpo-errors.s
Reid Kleckner c7b264dacb [codeview] Implement FPO data assembler directives
Summary:
This adds a set of new directives that describe 32-bit x86 prologues.
The directives are limited and do not expose the full complexity of
codeview FPO data. They are merely a convenience for the compiler to
generate more readable assembly so we don't need to generate tons of
labels in CodeGen. If our prologue emission changes in the future, we
can change the set of available directives to suit our needs. These are
modelled after the .seh_ directives, which use a different format that
interacts with exception handling.

The directives are:
  .cv_fpo_proc _foo
  .cv_fpo_pushreg ebp/ebx/etc
  .cv_fpo_setframe ebp/esi/etc
  .cv_fpo_stackalloc 200
  .cv_fpo_endprologue
  .cv_fpo_endproc
  .cv_fpo_data _foo

I tried to follow the implementation of ARM EHABI CFI directives by
sinking most directives out of MCStreamer and into X86TargetStreamer.
This helps avoid polluting non-X86 code with WinCOFF specific logic.

I used cdb to confirm that this can show locals in parent CSRs in a few
cases, most importantly the one where we use ESI as a frame pointer,
i.e. the one in http://crbug.com/756153#c28

Once we have cdb integration in debuginfo-tests, we can add integration
tests there.

Reviewers: majnemer, hans

Subscribers: aemerson, mgorny, kristof.beyls, llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D38776

llvm-svn: 315513
2017-10-11 21:24:33 +00:00

48 lines
1.6 KiB
ArmAsm

# RUN: not llvm-mc < %s -triple i686-windows-msvc -o /dev/null 2>&1 | FileCheck %s --implicit-check-not=error:
.globl _foo
_foo:
.cv_fpo_proc
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected symbol name
.cv_fpo_proc 1
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected symbol name
.cv_fpo_proc _foo extra
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected parameter byte count
.cv_fpo_proc _foo 4 extra
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: unexpected tokens in '.cv_fpo_proc' directive
.cv_fpo_proc _foo 4
pushl %ebp
.cv_fpo_pushreg 1
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: invalid register name in '.cv_fpo_pushreg' directive
.cv_fpo_pushreg ebp
subl $20, %esp
.cv_fpo_stackalloc asdf
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected offset in '.cv_fpo_stackalloc' directive
.cv_fpo_stackalloc 20 asdf
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: unexpected tokens in '.cv_fpo_stackalloc' directive
.cv_fpo_stackalloc 20
.cv_fpo_endprologue asdf
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: unexpected tokens in '.cv_fpo_endprologue' directive
.cv_fpo_endprologue
addl $20, %esp
popl %ebp
retl
.cv_fpo_endproc asdf
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: unexpected tokens in '.cv_fpo_endproc' directive
.cv_fpo_endproc
.section .debug$S,"dr"
.p2align 2
.long 4 # Debug section magic
.cv_fpo_data
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected symbol name
.cv_fpo_data 1
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected symbol name
.cv_fpo_data _foo asdf
# CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: unexpected tokens in '.cv_fpo_data' directive
.cv_fpo_data _foo
.long 0