11// RUN: %target-swift-emit-silgen -parse-as-library %s | %FileCheck %s
22
3- // CHECK: sil private [global_init_once_fn] [ossa] @[[T:.*]]WZ : $@convention(c) () -> () {
3+ // CHECK: sil private [global_init_once_fn] [ossa] @[[T:.*]]WZ : $@convention(c) (Builtin.RawPointer ) -> () {
44// CHECK: alloc_global @$s12lazy_globals1xSiv
55// CHECK: [[XADDR:%.*]] = global_addr @$s12lazy_globals1xSivp : $*Int
66// CHECK: store {{%.*}} to [trivial] [[XADDR]] : $*Int
77
88// CHECK: sil hidden [global_init] [ossa] @$s12lazy_globals1xSivau : $@convention(thin) () -> Builtin.RawPointer {
99// CHECK: [[TOKEN_ADDR:%.*]] = global_addr @[[T]]Wz : $*Builtin.Word
1010// CHECK: [[TOKEN_PTR:%.*]] = address_to_pointer [[TOKEN_ADDR]] : $*Builtin.Word to $Builtin.RawPointer
11- // CHECK: [[INIT_FUNC:%.*]] = function_ref @[[T]]WZ : $@convention(c) () -> ()
12- // CHECK: builtin "once"([[TOKEN_PTR]] : $Builtin.RawPointer, [[INIT_FUNC]] : $@convention(c) () -> ()) : $()
11+ // CHECK: [[INIT_FUNC:%.*]] = function_ref @[[T]]WZ : $@convention(c) (Builtin.RawPointer ) -> ()
12+ // CHECK: builtin "once"([[TOKEN_PTR]] : $Builtin.RawPointer, [[INIT_FUNC]] : $@convention(c) (Builtin.RawPointer ) -> ()) : $()
1313// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @$s12lazy_globals1xSivp : $*Int
1414// CHECK: [[GLOBAL_PTR:%.*]] = address_to_pointer [[GLOBAL_ADDR]] : $*Int to $Builtin.RawPointer
1515// CHECK: return [[GLOBAL_PTR]] : $Builtin.RawPointer
1616// CHECK: }
1717var x : Int = 0
1818
19- // CHECK: sil private [global_init_once_fn] [ossa] @[[T:.*]]WZ : $@convention(c) () -> () {
19+ // CHECK: sil private [global_init_once_fn] [ossa] @[[T:.*]]WZ : $@convention(c) (Builtin.RawPointer ) -> () {
2020// CHECK: alloc_global @$s12lazy_globals3FooV3fooSivpZ
2121// CHECK: [[XADDR:%.*]] = global_addr @$s12lazy_globals3FooV3fooSivpZ : $*Int
2222// CHECK: store {{.*}} to [trivial] [[XADDR]] : $*Int
@@ -26,8 +26,8 @@ struct Foo {
2626// CHECK: sil hidden [global_init] [ossa] @$s12lazy_globals3FooV3fooSivau : $@convention(thin) () -> Builtin.RawPointer {
2727// CHECK: [[TOKEN_ADDR:%.*]] = global_addr @[[T]]Wz : $*Builtin.Word
2828// CHECK: [[TOKEN_PTR:%.*]] = address_to_pointer [[TOKEN_ADDR]] : $*Builtin.Word to $Builtin.RawPointer
29- // CHECK: [[INIT_FUNC:%.*]] = function_ref @[[T]]WZ : $@convention(c) () -> ()
30- // CHECK: builtin "once"([[TOKEN_PTR]] : $Builtin.RawPointer, [[INIT_FUNC]] : $@convention(c) () -> ()) : $()
29+ // CHECK: [[INIT_FUNC:%.*]] = function_ref @[[T]]WZ : $@convention(c) (Builtin.RawPointer ) -> ()
30+ // CHECK: builtin "once"([[TOKEN_PTR]] : $Builtin.RawPointer, [[INIT_FUNC]] : $@convention(c) (Builtin.RawPointer ) -> ()) : $()
3131// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @$s12lazy_globals3FooV3fooSivpZ : $*Int
3232// CHECK: [[GLOBAL_PTR:%.*]] = address_to_pointer [[GLOBAL_ADDR]] : $*Int to $Builtin.RawPointer
3333// CHECK: return [[GLOBAL_PTR]] : $Builtin.RawPointer
@@ -40,7 +40,7 @@ struct Foo {
4040 static var initialized : Int = 57
4141}
4242
43- // CHECK: sil private [global_init_once_fn] [ossa] @[[T:.*3bar.*]]WZ : $@convention(c) () -> () {
43+ // CHECK: sil private [global_init_once_fn] [ossa] @[[T:.*3bar.*]]WZ : $@convention(c) (Builtin.RawPointer ) -> () {
4444// CHECK: alloc_global @$s12lazy_globals3BarO3barSivpZ
4545// CHECK: [[XADDR:%.*]] = global_addr @$s12lazy_globals3BarO3barSivpZ : $*Int
4646// CHECK: store {{.*}} to [trivial] [[XADDR]] : $*Int
@@ -50,8 +50,8 @@ enum Bar {
5050// CHECK: sil hidden [global_init] [ossa] @$s12lazy_globals3BarO3barSivau : $@convention(thin) () -> Builtin.RawPointer {
5151// CHECK: [[TOKEN_ADDR:%.*]] = global_addr @[[T]]Wz : $*Builtin.Word
5252// CHECK: [[TOKEN_PTR:%.*]] = address_to_pointer [[TOKEN_ADDR]] : $*Builtin.Word to $Builtin.RawPointer
53- // CHECK: [[INIT_FUNC:%.*]] = function_ref @[[T]]WZ : $@convention(c) () -> ()
54- // CHECK: builtin "once"([[TOKEN_PTR]] : $Builtin.RawPointer, [[INIT_FUNC]] : $@convention(c) () -> ()) : $()
53+ // CHECK: [[INIT_FUNC:%.*]] = function_ref @[[T]]WZ : $@convention(c) (Builtin.RawPointer ) -> ()
54+ // CHECK: builtin "once"([[TOKEN_PTR]] : $Builtin.RawPointer, [[INIT_FUNC]] : $@convention(c) (Builtin.RawPointer ) -> ()) : $()
5555// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @$s12lazy_globals3BarO3barSivpZ : $*Int
5656// CHECK: [[GLOBAL_PTR:%.*]] = address_to_pointer [[GLOBAL_ADDR]] : $*Int to $Builtin.RawPointer
5757// CHECK: return [[GLOBAL_PTR]] : $Builtin.RawPointer
@@ -63,13 +63,13 @@ enum Bar {
6363
6464func f( ) -> ( Int , Int ) { return ( 1 , 2 ) }
6565
66- // CHECK: sil private [global_init_once_fn] [ossa] @[[T:.*2a1.*2b1.*]]WZ : $@convention(c) () -> () {
66+ // CHECK: sil private [global_init_once_fn] [ossa] @[[T:.*2a1.*2b1.*]]WZ : $@convention(c) (Builtin.RawPointer ) -> () {
6767// CHECK: function_ref @$s12lazy_globals1fSi_SityF : $@convention(thin) () -> (Int, Int)
6868// CHECK: sil hidden [global_init] [ossa] @$s12lazy_globals2a1Sivau : $@convention(thin) () -> Builtin.RawPointer
69- // CHECK: function_ref @[[T]]WZ : $@convention(c) () -> ()
69+ // CHECK: function_ref @[[T]]WZ : $@convention(c) (Builtin.RawPointer ) -> ()
7070// CHECK: global_addr @$s12lazy_globals2a1Sivp : $*Int
7171// CHECK: sil hidden [global_init] [ossa] @$s12lazy_globals2b1Sivau : $@convention(thin) () -> Builtin.RawPointer {
72- // CHECK: function_ref @[[T]]WZ : $@convention(c) () -> ()
72+ // CHECK: function_ref @[[T]]WZ : $@convention(c) (Builtin.RawPointer ) -> ()
7373// CHECK: global_addr @$s12lazy_globals2b1Sivp : $*Int
7474var ( a1, b1) = f ( )
7575
0 commit comments