Files
swift-mirror/test/DebugInfo/weak-self-capture.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

20 lines
545 B
Swift

// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
public class ClosureMaker {
var a : Int
init (a : Int) { self.a = a }
public func getClosure() -> (() -> Int) {
return { [weak self] () -> Int in
if let _self = self {
return _self.a
} else {
return 0
}
}
}
}
// CHECK: define {{.*}} @"$s4main12ClosureMakerC03getB0SiycyFSiycfU_"
// CHECK: call void @llvm.dbg.declare(metadata %swift.weak** %{{.*}} !DIExpression(DW_OP_deref)),