mirror of
https://github.com/apple/swift.git
synced 2026-11-01 23:11:50 +01:00
Instructions generated as part of SILGenProlog for closure capture must be marked as in prologue, as stepping on them in LLDB is invalid. The debugger is not supposed to stop with the location of the variable being captured, in a state where the variable isn't available yet. rdar://176463223
24 lines
686 B
Swift
24 lines
686 B
Swift
// RUN: %target-swift-frontend %s -emit-sil -Xllvm -sil-print-debuginfo -Xllvm -sil-print-debuginfo-verbose -g -o - | %FileCheck %s
|
|
|
|
var escapee = {}
|
|
|
|
func bar() {
|
|
var arr = [1.0, 2, 3]
|
|
escapee = {
|
|
// Make sure that the project_box is marked as part of the prologue.
|
|
// CHECK: sil private @$s4main3baryyFyycfU_
|
|
// CHECK: bb0(%0 : @closureCapture ${ var Array<Double> }):
|
|
// CHECK: %1 = project_box %0, 0, loc {{.*}} isImplicit: false, isAutoGenerated: false, isHiddenFromDebugInfo: false, isInPrologue: true
|
|
// CHECK: debug_value %1, var, name "arr", argno 1, expr op_deref
|
|
for _ in arr {}
|
|
arr = []
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
bar()
|
|
escapee()
|
|
}
|
|
|
|
main()
|