Files
swift-mirror/test/DebugInfo/top_level_code.swift
Adrian Prantl 2f9f964219 Change the contract between Swift compiler and LLDB about how the function
prologue is handled in the line table.
We now mark the first instruction after the stack setup as end_prologue and
any further initilizations (which may include function calls to metadata
accessors) with line 0 which lldb will skip. This allows swiftc to emit
debug info for compiler-generated functions such as metadata accessors.
Mixing debug and non-debug functions is not very well supported by LLVM
and the resulting line table makes it impossible for LLDB to determine
where a function with debug info ends and a nondebug function starts.

rdar://problem/23042642

Swift SVN r32816
2015-10-22 00:20:03 +00:00

15 lines
361 B
Swift

// RUN: %target-swift-frontend %s -S -g -o - | FileCheck %s
// XFAIL: linux
func markUsed<T>(t: T) {}
var a = 1
var b = 2
markUsed(a+b)
// CHECK: _main:
// Verify that the top-level function (main) begins at line 0 and then
// proceeds to line 6.
// CHECK: .loc {{[0-9]}} 0 {{[0-9]}} prologue_end
// CHECK-NOT: .loc
// CHECK: .loc {{[0-9]}} 6 {{[0-9]}}