Files
swift-mirror/test/DebugInfo/mandatoryinlining-wrongdebugscope.swift

23 lines
796 B
Swift

// RUN: %target-swift-frontend -emit-sil %s -Onone -Xllvm \
// RUN: -sil-print-after=mandatory-inlining \
// RUN: -Xllvm -sil-print-debuginfo -o /dev/null 2>&1 | %FileCheck %s
// CHECK: destroy_value {{.*}} : $@callee_guaranteed () -> (), loc {{.*}}:21:5, scope [[SCOPE:[0-9]+]]
// CHECK: destroy_value {{.*}} : $@callee_guaranteed () -> @out (), loc {{.*}}:21:5, scope [[SCOPE]]
// CHECK: destroy_value {{.*}} : $@callee_guaranteed () -> (), loc {{.*}}:21:5, scope [[SCOPE]]
func patatino<d, i>(_ function: @escaping (d) -> i, g: d...) -> () -> i {
return { typealias h = ([d]) -> i
let f = unsafeBitCast(function, to: h.self)
return f(g)
}
}
func tinky() {
for b in 1...50{
let c = {}
let e = patatino(c)
e()
let f = {}
}
}