mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Most tests were using %swift or similar substitutions, which did not include the target triple and SDK. The driver was defaulting to the host OS. Thus, we could not run the tests when the standard library was not built for OS X. Swift SVN r24504
25 lines
926 B
Swift
25 lines
926 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 @_TF25array_literal_abstraction14array_of_funcsFT_GSaFT_T__
|
|
// CHECK: pointer_to_address {{.*}} $*@callee_owned (@out (), @in ()) -> ()
|
|
func array_of_funcs() -> [(() -> ())] {
|
|
return [{}, {}]
|
|
}
|
|
|
|
// CHECK-LABEL: sil hidden @_TF25array_literal_abstraction13dict_of_funcsFT_GVSs10DictionarySiFT_T__
|
|
// CHECK: pointer_to_address {{.*}} $*(Int, @callee_owned (@out (), @in ()) -> ())
|
|
func dict_of_funcs() -> Dictionary<Int, () -> ()> {
|
|
return [0: {}, 1: {}]
|
|
}
|
|
|
|
func vararg_funcs(fs: (() -> ())...) {}
|
|
|
|
// CHECK-LABEL: sil hidden @_TF25array_literal_abstraction17call_vararg_funcsFT_T_
|
|
// CHECK: pointer_to_address {{.*}} $*@callee_owned (@out (), @in ()) -> ()
|
|
func call_vararg_funcs() {
|
|
vararg_funcs({}, {})
|
|
}
|