1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/test/MC/COFF/cv-errors.s

57 lines
1.6 KiB
ArmAsm
Raw Normal View History

# RUN: not llvm-mc -triple=i686-pc-win32 %s -o /dev/null 2>&1 | FileCheck %s
[codeview] Add new directives to record inlined call site line info Summary: Previously we were trying to represent this with the "contains" list of the .cv_inline_linetable directive, which was not enough information. Now we directly represent the chain of inlined call sites, so we know what location to emit when we encounter a .cv_loc directive of an inner inlined call site while emitting the line table of an outer function or inlined call site. Fixes PR29146. Also fixes PR29147, where we would crash when .cv_loc directives crossed sections. Now we write down the section of the first .cv_loc directive, and emit an error if any other .cv_loc directive for that function is in a different section. Also fixes issues with discontiguous inlined source locations, like in this example: volatile int unlikely_cond = 0; extern void __declspec(noreturn) abort(); __forceinline void f() { if (!unlikely_cond) abort(); } int main() { unlikely_cond = 0; f(); unlikely_cond = 0; } Previously our tables gave bad location information for the 'abort' call, and the debugger wouldn't snow the inlined stack frame for 'f'. It is important to emit good line tables for this code pattern, because it comes up whenever an asan bug occurs in an inlined function. The __asan_report* stubs are generally placed after the normal function epilogue, leading to discontiguous regions of inlined code. Reviewers: majnemer, amccarth Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24014 llvm-svn: 280822
2016-09-07 18:15:31 +02:00
.text
foo:
.cv_file a
# CHECK: error: expected file number in '.cv_file' directive
# CHECK-NOT: error:
.cv_file 0 "t.cpp"
# CHECK: error: file number less than one
# CHECK-NOT: error:
.cv_func_id x
# CHECK: error: expected function id in '.cv_func_id' directive
# CHECK-NOT: error:
.cv_func_id -1
# CHECK: error: expected function id in '.cv_func_id' directive
# CHECK-NOT: error:
.cv_func_id 0xFFFFFFFFFFFFFFFF
# CHECK: error: expected function id within range [0, UINT_MAX)
# CHECK-NOT: error:
.cv_inline_site_id x
# CHECK: error: expected function id in '.cv_inline_site_id' directive
# CHECK-NOT: error:
.cv_file 1 "t.cpp"
.cv_func_id 0
.cv_inline_site_id 0 0 0 0 0 0
# CHECK: error: expected 'within' identifier in '.cv_inline_site_id' directive
# CHECK-NOT: error:
.cv_inline_site_id 0 within a
# CHECK: error: expected function id in '.cv_inline_site_id' directive
# CHECK-NOT: error:
.cv_inline_site_id 0 within 0 x
# CHECK: error: expected 'inlined_at' identifier in '.cv_inline_site_id' directive
# CHECK-NOT: error:
.cv_inline_site_id 0 within 0 inlined_at 0 0 0
# CHECK: error: file number less than one in '.cv_inline_site_id' directive
# CHECK-NOT: error:
.cv_inline_site_id 0 within 0 inlined_at 10 0 0
# CHECK: error: unassigned file number in '.cv_inline_site_id' directive
# CHECK-NOT: error:
.cv_inline_site_id 0 within 0 inlined_at 1 1 1
# CHECK: error: function id already allocated
# CHECK-NOT: error:
.cv_inline_site_id 1 within 0 inlined_at 1 1 1
.cv_loc 0 1 1 1 # t.cpp:1:1
nop
.cv_loc 1 1 1 1 # t.cpp:1:1
nop