1
1
// RUN: %target-swift-emit-silgen -parse-as-library %s | %FileCheck %s
2
2
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 ) -> () {
4
4
// CHECK: alloc_global @$s12lazy_globals1xSiv
5
5
// CHECK: [[XADDR:%.*]] = global_addr @$s12lazy_globals1xSivp : $*Int
6
6
// CHECK: store {{%.*}} to [trivial] [[XADDR]] : $*Int
7
7
8
8
// CHECK: sil hidden [global_init] [ossa] @$s12lazy_globals1xSivau : $@convention(thin) () -> Builtin.RawPointer {
9
9
// CHECK: [[TOKEN_ADDR:%.*]] = global_addr @[[T]]Wz : $*Builtin.Word
10
10
// 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 ) -> ()) : $()
13
13
// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @$s12lazy_globals1xSivp : $*Int
14
14
// CHECK: [[GLOBAL_PTR:%.*]] = address_to_pointer [[GLOBAL_ADDR]] : $*Int to $Builtin.RawPointer
15
15
// CHECK: return [[GLOBAL_PTR]] : $Builtin.RawPointer
16
16
// CHECK: }
17
17
var x : Int = 0
18
18
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 ) -> () {
20
20
// CHECK: alloc_global @$s12lazy_globals3FooV3fooSivpZ
21
21
// CHECK: [[XADDR:%.*]] = global_addr @$s12lazy_globals3FooV3fooSivpZ : $*Int
22
22
// CHECK: store {{.*}} to [trivial] [[XADDR]] : $*Int
@@ -26,8 +26,8 @@ struct Foo {
26
26
// CHECK: sil hidden [global_init] [ossa] @$s12lazy_globals3FooV3fooSivau : $@convention(thin) () -> Builtin.RawPointer {
27
27
// CHECK: [[TOKEN_ADDR:%.*]] = global_addr @[[T]]Wz : $*Builtin.Word
28
28
// 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 ) -> ()) : $()
31
31
// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @$s12lazy_globals3FooV3fooSivpZ : $*Int
32
32
// CHECK: [[GLOBAL_PTR:%.*]] = address_to_pointer [[GLOBAL_ADDR]] : $*Int to $Builtin.RawPointer
33
33
// CHECK: return [[GLOBAL_PTR]] : $Builtin.RawPointer
@@ -40,7 +40,7 @@ struct Foo {
40
40
static var initialized : Int = 57
41
41
}
42
42
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 ) -> () {
44
44
// CHECK: alloc_global @$s12lazy_globals3BarO3barSivpZ
45
45
// CHECK: [[XADDR:%.*]] = global_addr @$s12lazy_globals3BarO3barSivpZ : $*Int
46
46
// CHECK: store {{.*}} to [trivial] [[XADDR]] : $*Int
@@ -50,8 +50,8 @@ enum Bar {
50
50
// CHECK: sil hidden [global_init] [ossa] @$s12lazy_globals3BarO3barSivau : $@convention(thin) () -> Builtin.RawPointer {
51
51
// CHECK: [[TOKEN_ADDR:%.*]] = global_addr @[[T]]Wz : $*Builtin.Word
52
52
// 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 ) -> ()) : $()
55
55
// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @$s12lazy_globals3BarO3barSivpZ : $*Int
56
56
// CHECK: [[GLOBAL_PTR:%.*]] = address_to_pointer [[GLOBAL_ADDR]] : $*Int to $Builtin.RawPointer
57
57
// CHECK: return [[GLOBAL_PTR]] : $Builtin.RawPointer
@@ -63,13 +63,13 @@ enum Bar {
63
63
64
64
func f( ) -> ( Int , Int ) { return ( 1 , 2 ) }
65
65
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 ) -> () {
67
67
// CHECK: function_ref @$s12lazy_globals1fSi_SityF : $@convention(thin) () -> (Int, Int)
68
68
// 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 ) -> ()
70
70
// CHECK: global_addr @$s12lazy_globals2a1Sivp : $*Int
71
71
// 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 ) -> ()
73
73
// CHECK: global_addr @$s12lazy_globals2b1Sivp : $*Int
74
74
var ( a1, b1) = f ( )
75
75
0 commit comments