Files
swift-mirror/test/SILGen/array_literal_abstraction.swift
Dmitri Hrybenko 3b04d1b013 tests: reorganize tests so that they actually use the target platform
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
2015-01-19 06:52:49 +00:00

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({}, {})
}