1111import Module
1212import ModuleTBD
1313
14+ // static ModuleStruct.privateFunctionPointer
1415// CHECK-LABEL: sil_global public_external @$s6Module0A6StructV22privateFunctionPointeryS2icvpZ : $@callee_guaranteed (Int) -> Int{{$}}
16+
17+ // static ModuleStruct.publicFunctionPointer
18+ // CHECK-LABEL: sil_global public_external [serialized] @$s6Module0A6StructV21publicFunctionPointeryS2icvpZ : $@callee_guaranteed (Int) -> Int
19+
20+
21+ // CHECK-LABEL: sil @$s4Main26callPrivateFunctionPointeryS2iF : $@convention(thin) (Int) -> Int {
22+ // CHECK: global_addr @$s6Module0A6StructV22privateFunctionPointeryS2icvpZ
23+ // CHECK: load
24+ // CHECK: apply
1525public func callPrivateFunctionPointer( _ x: Int ) -> Int {
1626 return Module . ModuleStruct. privateFunctionPointer ( x)
1727}
1828
19- // CHECK-LABEL: sil_global package_external @$s6Module03PkgA6StructV14closurePointeryS2icvpZ : $@callee_guaranteed (Int) -> Int{{$}}
29+ // CHECK-LABEL: sil package @$s4Main27callStaticPkgClosurePointeryS2iF : $@convention(thin) (Int) -> Int {
30+ // CHECK: function_ref @$s6Module03PkgA6StructV14closurePointeryS2icvau
31+ // CHECK: apply
32+ // CHECK: pointer_to_address
33+ // CHECK: load
34+ // CHECK: apply
35+
36+ // PkgModuleStruct.closurePointer.unsafeMutableAddressor
37+ // CHECK: sil package_external [global_init] @$s6Module03PkgA6StructV14closurePointeryS2icvau : $@convention(thin) () -> Builtin.RawPointer
2038package func callStaticPkgClosurePointer( _ x: Int ) -> Int {
2139 return Module . PkgModuleStruct. closurePointer ( x)
2240}
2341
24- // static ModuleStruct.publicFunctionPointer
25- // CHECK-LABEL: sil_global public_external [serialized] @$s6Module0A6StructV21publicFunctionPointeryS2icvpZ : $@callee_guaranteed (Int) -> Int
26- // static PkgModuleStruct.funcPointer
27- // CHECK-LABEL: sil_global package_external [serialized] @$s6Module03PkgA6StructV11funcPointeryS2icvpZ : $@callee_guaranteed (Int) -> Int
28-
29-
3042// CHECK-LABEL: sil @$s4Main25callPublicFunctionPointeryS2iF : $@convention(thin) (Int) -> Int {
3143// CHECK: global_addr @$s6Module0A6StructV21publicFunctionPointeryS2icvpZ : $*@callee_guaranteed (Int) -> Int
3244// CHECK: load
@@ -37,10 +49,14 @@ public func callPublicFunctionPointer(_ x: Int) -> Int {
3749}
3850
3951// CHECK-LABEL: sil package @$s4Main28callStaticPkgFunctionPointeryS2iF : $@convention(thin) (Int) -> Int {
40- // CHECK: global_addr @$s6Module03PkgA6StructV11funcPointeryS2icvpZ : $*@callee_guaranteed (Int) -> Int
52+ // CHECK: function_ref @$s6Module03PkgA6StructV11funcPointeryS2icvau
53+ // CHECK: pointer_to_address
4154// CHECK: load
4255// CHECK: apply
4356// CHECK: } // end sil function '$s4Main28callStaticPkgFunctionPointeryS2iF'
57+
58+ // PkgModuleStruct.funcPointer.unsafeMutableAddressor
59+ // CHECK-LABEL: sil package_external [global_init] @$s6Module03PkgA6StructV11funcPointeryS2icvau : $@convention(thin) () -> Builtin.RawPointer
4460package func callStaticPkgFunctionPointer( _ x: Int ) -> Int {
4561 return Module . PkgModuleStruct. funcPointer ( x)
4662}
@@ -68,9 +84,12 @@ public func doIncrement(_ x: Int) -> Int {
6884}
6985
7086// CHECK-LABEL: sil package @$s4Main11callPkgFuncyS2iF : $@convention(thin) (Int) -> Int {
71- // CHECK-NOT : function_ref
72- // CHECK-NOT: apply
87+ // CHECK: function_ref @$s6Module7pkgFuncyS2iF
88+ // CHECK: apply
7389// CHECK: } // end sil function '$s4Main11callPkgFuncyS2iF'
90+
91+ // pkgFunc(_:)
92+ // CHECK-LABEL: sil package_external @$s6Module7pkgFuncyS2iF : $@convention(thin) (Int) -> Int
7493package func callPkgFunc( _ x: Int ) -> Int {
7594 return Module . pkgFunc ( x)
7695}
@@ -83,8 +102,10 @@ public func doIncrementWithCall(_ x: Int) -> Int {
83102}
84103
85104// CHECK-LABEL: sil package @$s4Main16callPkgFuncNoCMOyS2iF : $@convention(thin) (Int) -> Int {
86- // CHECK: function_ref @$s9Submodule15subPkgFuncNoCMOyS2iF
105+ // CHECK: function_ref @$s6Module12pkgFuncNoCMOyS2iF
87106// CHECK: } // end sil function '$s4Main16callPkgFuncNoCMOyS2iF'
107+ // pkgFuncNoCMO(_:)
108+ // CHECK-LABEL: sil package_external @$s6Module12pkgFuncNoCMOyS2iF : $@convention(thin) (Int) -> Int
88109package func callPkgFuncNoCMO( _ x: Int ) -> Int {
89110 return Module . pkgFuncNoCMO ( x)
90111}
@@ -98,9 +119,11 @@ public func doIncrementTBD(_ x: Int) -> Int {
98119}
99120
100121// CHECK-LABEL: sil package @$s4Main14callPkgFuncTBDyS2iF : $@convention(thin) (Int) -> Int {
101- // CHECK-NOT : function_ref
102- // CHECK-NOT: apply
122+ // CHECK: function_ref @$s9ModuleTBD7pkgFuncyS2iF
123+ // CHECK: apply
103124// CHECK: } // end sil function '$s4Main14callPkgFuncTBDyS2iF'
125+ // pkgFunc(_:)
126+ // CHECK-LABEL: sil package_external @$s9ModuleTBD7pkgFuncyS2iF : $@convention(thin) (Int) -> Int
104127package func callPkgFuncTBD( _ x: Int ) -> Int {
105128 return ModuleTBD . pkgFunc ( x)
106129}
@@ -130,9 +153,11 @@ public func getSubmoduleKlassMember() -> Int {
130153}
131154
132155// CHECK-LABEL: sil package @$s4Main26getPkgSubmoduleKlassMemberSiyF : $@convention(thin) () -> Int {
133- // CHECK-NOT : function_ref
134- // CHECK-NOT: apply
156+ // CHECK: function_ref @$s6Module23pkgSubmoduleKlassMemberSiyF
157+ // CHECK: apply
135158// CHECK: } // end sil function '$s4Main26getPkgSubmoduleKlassMemberSiyF'
159+ // pkgSubmoduleKlassMember()
160+ // CHECK-LABEL: sil package_external @$s6Module23pkgSubmoduleKlassMemberSiyF : $@convention(thin) () -> Int
136161package func getPkgSubmoduleKlassMember( ) -> Int {
137162 return Module . pkgSubmoduleKlassMember ( )
138163}
@@ -146,9 +171,12 @@ public func getSubmoduleKlassMemberTBD() -> Int {
146171}
147172
148173// CHECK-LABEL: sil package @$s4Main29getPkgSubmoduleKlassMemberTBDSiyF : $@convention(thin) () -> Int {
149- // CHECK-NOT : function_ref
150- // CHECK-NOT : apply
174+ // CHECK: function_ref @$s9ModuleTBD23pkgSubmoduleKlassMemberSiyF
175+ // CHECK: apply
151176// CHECK: } // end sil function '$s4Main29getPkgSubmoduleKlassMemberTBDSiyF'
177+
178+ // pkgSubmoduleKlassMember()
179+ // CHECK-LABEL:sil package_external @$s9ModuleTBD23pkgSubmoduleKlassMemberSiyF : $@convention(thin) () -> Int
152180package func getPkgSubmoduleKlassMemberTBD( ) -> Int {
153181 return ModuleTBD . pkgSubmoduleKlassMember ( )
154182}
@@ -162,9 +190,11 @@ public func getModuleKlassMember() -> Int {
162190}
163191
164192// CHECK-LABEL: sil package @$s4Main23getPkgModuleKlassMemberSiyF : $@convention(thin) () -> Int {
165- // CHECK-NOT : function_ref
166- // CHECK-NOT: apply
193+ // CHECK: function_ref @$s6Module03pkgA11KlassMemberSiyF
194+ // CHECK: apply
167195// CHECK: } // end sil function '$s4Main23getPkgModuleKlassMemberSiyF'
196+ // pkgModuleKlassMember()
197+ // CHECK-LABEL: sil package_external @$s6Module03pkgA11KlassMemberSiyF : $@convention(thin) () -> Int
168198package func getPkgModuleKlassMember( ) -> Int {
169199 return Module . pkgModuleKlassMember ( )
170200}
@@ -178,14 +208,14 @@ public func getModuleKlassMemberTBD() -> Int {
178208}
179209
180210// CHECK-LABEL: sil package @$s4Main26getPkgModuleKlassMemberTBDSiyF : $@convention(thin) () -> Int {
181- // CHECK-NOT : function_ref
182- // CHECK-NOT: apply
211+ // CHECK: function_ref @$s9ModuleTBD03pkgA11KlassMemberSiyF
212+ // CHECK: apply
183213// CHECK: } // end sil function '$s4Main26getPkgModuleKlassMemberTBDSiyF'
214+ // pkgModuleKlassMember()
215+ // CHECK-LABEL: sil package_external @$s9ModuleTBD03pkgA11KlassMemberSiyF : $@convention(thin) () -> Int
184216package func getPkgModuleKlassMemberTBD( ) -> Int {
185217 return ModuleTBD . pkgModuleKlassMember ( )
186218}
187219
188220
189221// CHECK-LABEL: sil [_semantics "optimize.no.crossmodule"] @$s9Submodule19incrementByOneNoCMOyS2iF : $@convention(thin) (Int) -> Int
190-
191- // CHECK-LABEL: sil package_external [_semantics "optimize.no.crossmodule"] @$s9Submodule15subPkgFuncNoCMOyS2iF : $@convention(thin) (Int) -> Int
0 commit comments