Files
swift-mirror/test/DebugInfo/WeakCapture.swift
Erik Eckstein 39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00

24 lines
645 B
Swift

// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
class A {
init(handler: (() -> ())) { }
}
class B { }
// CHECK: define {{.*}} @"$s11WeakCapture8functionyyF"()
func function() {
let b = B()
// Ensure that the local b and its weak copy are distinct local variables.
// CHECK: call void @llvm.dbg.{{.*}}(metadata %T11WeakCapture1BC*
// CHECK-SAME: metadata [[B:.*]], metadata
// CHECK: call void @llvm.dbg.{{.*}}(metadata %swift.weak*
// CHECK-NOT: metadata [[B]]
// CHECK: call
A(handler: { [weak b] in
if b != nil { }
})
}
function()