Files
swift-mirror/test/SILGen/capture_inout.swift
Joe Groff c0a2994564 AST: Start printing function types with @convention instead of old attributes.
And update tests to match.

Swift SVN r27262
2015-04-13 22:51:34 +00:00

18 lines
696 B
Swift

// RUN: %target-swift-frontend -parse-stdlib -emit-silgen %s | FileCheck %s
typealias Int = Builtin.Int64
// CHECK: sil hidden @_TF13capture_inout3foo
// CHECK: bb0([[X_INOUT:%.*]] : $*Builtin.Int64):
// CHECK: [[X_LOCAL:%.*]] = alloc_box $Builtin.Int64
// CHECK: [[FUNC:%.*]] = function_ref [[CLOSURE:@.*]] : $@convention(thin) (@owned Builtin.NativeObject, @inout Builtin.Int64) -> Builtin.Int64
// CHECK: partial_apply [[FUNC]]([[X_LOCAL]]#0, [[X_LOCAL]]#1)
// CHECK: }
// CHECK: sil shared [[CLOSURE]] : $@convention(thin) (@owned Builtin.NativeObject, @inout Builtin.Int64) -> Builtin.Int64
func foo(inout x: Int) -> () -> Int {
func bar() -> Int {
return x
}
return bar
}