mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Test for swift_deallocUninitializedObject
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: swift_feature_Embedded
|
||||
|
||||
|
||||
|
||||
func f() -> Bool? { return nil }
|
||||
|
||||
public class MyClass {
|
||||
var handler: (()->())? = nil
|
||||
func foo() {
|
||||
@@ -32,5 +36,12 @@ struct Main {
|
||||
o!.foo() // CHECK: capture local
|
||||
print(local == 43 ? "43" : "???") // CHECK: 43
|
||||
o = nil // CHECK: deinit
|
||||
|
||||
let closure = {
|
||||
guard var b = f() else { print("success"); return }
|
||||
let c = { b = true }
|
||||
_ = (b, c)
|
||||
}
|
||||
closure() // CHECK: success
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user