Files
swift-mirror/test/SIL/Parser/global_init_attribute.sil
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

21 lines
580 B
Plaintext

// RUN: %target-swift-frontend %s -emit-silgen | FileCheck %s
sil_stage canonical
import Builtin
import Swift
// We cannot deserialize a SILDeclRef of kind GlobalAccessor, so this
// is not a proper addressor. But at least we can parse
// "[global_init]".
//
// CHECK-LABEL: g.MyVar.unsafeMutableAddressor : Swift.Int
// CHECK-NEXT: sil [global_init] @_TF1gau5MyVarSi
sil [global_init] @_TF1gau5MyVarSi : $@convention(thin) () -> Builtin.RawPointer {
bb0:
%b = alloc_box $Int
%p = address_to_pointer %b#1 : $*Int to $Builtin.RawPointer
return %p : $Builtin.RawPointer
}