mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
- Fix block to func reabstraction thunks block argument handling - Forward cast ownership - Fix applyPartiallyAppliedSuperMethod ownership for @callee_guaranteed closures - Avoid a copy in buildBlockToFuncThunkBody - Update tests for callee_guaranteed closures SR-5441 rdar://33255593
25 lines
919 B
Swift
25 lines
919 B
Swift
// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s
|
|
|
|
// Verify that reabstraction happens when forming container literals.
|
|
// <rdar://problem/16039286>
|
|
|
|
// CHECK-LABEL: sil hidden @_T025array_literal_abstraction0A9_of_funcsSayyycGyF
|
|
// CHECK: pointer_to_address {{.*}} $*@callee_guaranteed (@in ()) -> @out ()
|
|
func array_of_funcs() -> [(() -> ())] {
|
|
return [{}, {}]
|
|
}
|
|
|
|
// CHECK-LABEL: sil hidden @_T025array_literal_abstraction13dict_of_funcss10DictionaryVySiyycGyF
|
|
// CHECK: pointer_to_address {{.*}} $*(Int, @callee_guaranteed (@in ()) -> @out ())
|
|
func dict_of_funcs() -> Dictionary<Int, () -> ()> {
|
|
return [0: {}, 1: {}]
|
|
}
|
|
|
|
func vararg_funcs(_ fs: (() -> ())...) {}
|
|
|
|
// CHECK-LABEL: sil hidden @_T025array_literal_abstraction17call_vararg_funcsyyF
|
|
// CHECK: pointer_to_address {{.*}} $*@callee_guaranteed (@in ()) -> @out ()
|
|
func call_vararg_funcs() {
|
|
vararg_funcs({}, {})
|
|
}
|