22// RUN: %target-swift-frontend -emit-silgen %s -parse-as-library -module-name Test | %FileCheck %s --check-prefixes=CHECK,CHECK-NO-SKIP
33// RUN: %target-swift-frontend -emit-silgen %s -parse-as-library -module-name Test -experimental-skip-non-exportable-decls | %FileCheck %s --check-prefixes=CHECK,CHECK-SKIP
44
5+ import Swift
6+
57// CHECK-NO-SKIP: sil private{{.*}} @$s4Test11privateFunc33_E3F0E1C7B46D05C8067CB98677DE566CLLyyF : $@convention(thin) () -> () {
68// CHECK-SKIP-NOT: s4Test11privateFunc33_E3F0E1C7B46D05C8067CB98677DE566CLLyyF
79private func privateFunc( ) { }
@@ -10,9 +12,39 @@ private func privateFunc() {}
1012// CHECK-SKIP-NOT: s4Test12internalFuncyyF
1113internal func internalFunc( ) { }
1214
15+ // CHECK-NO-SKIP: sil hidden{{.*}} @$s4Test022internalFuncWithNestedC0yyF : $@convention(thin) () -> () {
16+ // CHECK-SKIP-NOT: s4Test022internalFuncWithNestedC0yyF
17+ internal func internalFuncWithNestedFunc( ) {
18+ func nested( ) { }
19+ nested ( )
20+ }
21+ // CHECK-NO-SKIP: sil private{{.*}} @$s4Test022internalFuncWithNestedC0yyF6nestedL_yyF : $@convention(thin) () -> () {
22+ // CHECK-SKIP-NOT: s4Test022internalFuncWithNestedC0yyF6nestedL_yyF
23+
1324// CHECK: sil{{.*}} @$s4Test10publicFuncyyF : $@convention(thin) () -> () {
1425public func publicFunc( ) { }
1526
27+ // CHECK: sil{{.*}} @$s4Test25publicFuncWithNestedFuncsyyF : $@convention(thin) () -> () {
28+ public func publicFuncWithNestedFuncs( ) {
29+ defer { publicFunc ( ) }
30+ func nested( ) { }
31+ nested ( )
32+ }
33+ // CHECK: sil private{{.*}} @$s4Test25publicFuncWithNestedFuncsyyF6$deferL_yyF : $@convention(thin) () -> () {
34+ // CHECK: sil private{{.*}} @$s4Test25publicFuncWithNestedFuncsyyF6nestedL_yyF : $@convention(thin) () -> () {
35+
36+ // CHECK: sil [serialized]{{.*}} @$s4Test13inlinableFuncyyF : $@convention(thin) () -> () {
37+ @inlinable internal func inlinableFunc( ) { }
38+
39+ // CHECK: sil [serialized]{{.*}} @$s4Test023inlinableFuncWithNestedC0yyF : $@convention(thin) () -> () {
40+ @inlinable internal func inlinableFuncWithNestedFunc( ) {
41+ defer { publicFunc ( ) }
42+ func nested( ) { }
43+ nested ( )
44+ }
45+ // CHECK: sil shared [serialized]{{.*}} @$s4Test023inlinableFuncWithNestedC0yyF6$deferL_yyF : $@convention(thin) () -> () {
46+ // CHECK: sil shared [serialized]{{.*}} @$s4Test023inlinableFuncWithNestedC0yyF6nestedL_yyF : $@convention(thin) () -> () {
47+
1648private class PrivateClass {
1749 // CHECK-NO-SKIP: sil private{{.*}} @$s4Test12PrivateClass33_E3F0E1C7B46D05C8067CB98677DE566CLLCfd : $@convention(method) (@guaranteed PrivateClass) -> @owned Builtin.NativeObject {
1850 // CHECK-SKIP-NOT: s4Test12PrivateClass33_E3F0E1C7B46D05C8067CB98677DE566CLLCfd
0 commit comments