Files
swift-mirror/test/DebugInfo/capturelist.swift
Erik Eckstein 1d3724666f tests: convert about 400 tests to the new mangling by using the -new-mangling-for-tests option
When the new mangling is enabled permanently, the option can be removed from the RUN command lines again.
2017-01-24 15:27:45 -08:00

21 lines
587 B
Swift

// RUN: %target-swift-frontend -Xllvm -new-mangling-for-tests %s -emit-ir -g -o - | %FileCheck %s
class C {
func withClosure(_ : () -> ()) -> () {}
func f() {
// CHECK: define{{.*}}_T011capturelist1CC1fyyFyycfU_
// There should not be a local weak variable "self" shadowing the
// implicit self argument.
// let self
// CHECK: call void @llvm.dbg
// let s
// CHECK: call void @llvm.dbg
// var weak self
// CHECK-NOT: call void @llvm.dbg
// CHECK: ret void
withClosure { [weak self] in
guard let s = self else { return }
}
}
}