mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
25 lines
420 B
Swift
25 lines
420 B
Swift
// RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -wmo) | %FileCheck %s
|
|
|
|
// REQUIRES: swift_in_compiler
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
public struct ZeroSizedStruct {}
|
|
|
|
var escape: (()->())? = nil
|
|
|
|
public func sink<T>(t: inout T) {
|
|
|
|
}
|
|
|
|
public func foo() {
|
|
var s = ZeroSizedStruct()
|
|
escape = {
|
|
sink(t: &s)
|
|
}
|
|
}
|
|
|
|
foo()
|
|
print("OK!")
|
|
// CHECK: OK!
|