mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Recent versions of LLDB can deal with line 0 locations much better and due to a subtle bug in the heuristic instructions immediately following the prologue could end up without debug locations which can cause serious problems for the LLVM inliner when constructing inline debug scope info. <rdar://problem/24394944>
17 lines
581 B
Swift
17 lines
581 B
Swift
// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
|
|
|
|
func markUsed<T>(t: T) {}
|
|
|
|
func main() {
|
|
// CHECK: call void @llvm.dbg.declare(metadata %"protocol<>"* {{.*}}, metadata ![[S:.*]], metadata !{{[0-9]+}}), !dbg ![[DBG:.*]]
|
|
// CHECK: ![[SCOPE:.*]] = distinct !DILexicalBlock({{.*}}line: 5, column: 13)
|
|
// CHECK: ![[S]] = !DILocalVariable(name: "s", {{.*}}line: [[@LINE+2]]
|
|
// CHECK: ![[DBG]] = !DILocation(line: [[@LINE+1]], column: 7, scope: ![[SCOPE]])
|
|
var s: Any = "hello world"
|
|
var n: Any = 12
|
|
var t: Any = (1,2)
|
|
markUsed("hello world")
|
|
}
|
|
|
|
main()
|