mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Also, add a third [serializable] state for functions whose bodies we *can* serialize, but only do so if they're referenced from another serialized function. This will be used for bodies synthesized for imported definitions, such as init(rawValue:), etc, and various thunks, but for now this change is NFC.
20 lines
697 B
Swift
20 lines
697 B
Swift
// RUN: %target-swift-frontend %s -emit-sil -O -o - -verify | %FileCheck %s
|
|
|
|
// Make sure we do not specialize resilientCallee.
|
|
|
|
// CHECK-LABEL: sil [serialized] [always_inline] @_T026closure_specialize_fragile0C6CalleryyF : $@convention(thin) () -> ()
|
|
// CHECK: function_ref @_T026closure_specialize_fragile15resilientCalleeyyyc2fn_tF : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
|
|
// CHECK: return
|
|
|
|
@inline(__always) public func fragileCaller() {
|
|
resilientCallee {
|
|
print("Hi")
|
|
}
|
|
}
|
|
|
|
// CHECK-LABEL: sil @_T026closure_specialize_fragile15resilientCalleeyyyc2fn_tF : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
|
|
|
|
public func resilientCallee(fn: () -> ()) {
|
|
fn()
|
|
}
|