|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: %target-swift-frontend -emit-silgen %s -parse-as-library -module-name Test | %FileCheck %s --check-prefixes=CHECK,CHECK-NO-SKIP |
| 3 | +// 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 |
| 4 | + |
| 5 | +// CHECK-NO-SKIP: sil private{{.*}} @$s4Test11privateFunc33_E3F0E1C7B46D05C8067CB98677DE566CLLyyF : $@convention(thin) () -> () { |
| 6 | +// CHECK-SKIP-NOT: s4Test11privateFunc33_E3F0E1C7B46D05C8067CB98677DE566CLLyyF |
| 7 | +private func privateFunc() {} |
| 8 | + |
| 9 | +// CHECK-NO-SKIP: sil hidden{{.*}} @$s4Test12internalFuncyyF : $@convention(thin) () -> () { |
| 10 | +// CHECK-SKIP-NOT: s4Test12internalFuncyyF |
| 11 | +internal func internalFunc() {} |
| 12 | + |
| 13 | +// CHECK: sil{{.*}} @$s4Test10publicFuncyyF : $@convention(thin) () -> () { |
| 14 | +public func publicFunc() {} |
| 15 | + |
| 16 | +private class PrivateClass { |
| 17 | + // CHECK-NO-SKIP: sil private{{.*}} @$s4Test12PrivateClass33_E3F0E1C7B46D05C8067CB98677DE566CLLCfd : $@convention(method) (@guaranteed PrivateClass) -> @owned Builtin.NativeObject { |
| 18 | + // CHECK-SKIP-NOT: s4Test12PrivateClass33_E3F0E1C7B46D05C8067CB98677DE566CLLCfd |
| 19 | + |
| 20 | + // CHECK-NO-SKIP: sil private{{.*}} @$s4Test12PrivateClass33_E3F0E1C7B46D05C8067CB98677DE566CLLCfD : $@convention(method) (@owned PrivateClass) -> () { |
| 21 | + // CHECK-SKIP-NOT: s4Test12PrivateClass33_E3F0E1C7B46D05C8067CB98677DE566CLLCfD |
| 22 | + |
| 23 | + // CHECK-NO-SKIP: sil private{{.*}} @$s4Test12PrivateClass33_E3F0E1C7B46D05C8067CB98677DE566CLLCADycfC : $@convention(method) (@thick PrivateClass.Type) -> @owned PrivateClass { |
| 24 | + // CHECK-SKIP-NOT: s4Test12PrivateClass33_E3F0E1C7B46D05C8067CB98677DE566CLLCADycfC |
| 25 | + |
| 26 | + // CHECK-NO-SKIP: sil private{{.*}} @$s4Test12PrivateClass33_E3F0E1C7B46D05C8067CB98677DE566CLLCADycfc : $@convention(method) (@owned PrivateClass) -> @owned PrivateClass { |
| 27 | + // CHECK-SKIP-NOT: s4Test12PrivateClass33_E3F0E1C7B46D05C8067CB98677DE566CLLCADycfc |
| 28 | +} |
| 29 | + |
| 30 | +public class PublicClass { |
| 31 | + // CHECK-NO-SKIP: sil hidden{{.*}} @$s4Test11PublicClassC14internalMethodyyF : $@convention(method) (@guaranteed PublicClass) -> () { |
| 32 | + // CHECK-SKIP-NOT: s4Test11PublicClassC14internalMethodyyF |
| 33 | + internal func internalMethod() {} |
| 34 | + |
| 35 | + // CHECK: sil{{.*}} @$s4Test11PublicClassCfd : $@convention(method) (@guaranteed PublicClass) -> @owned Builtin.NativeObject { |
| 36 | + |
| 37 | + // CHECK: sil{{.*}} @$s4Test11PublicClassCfD : $@convention(method) (@owned PublicClass) -> () { |
| 38 | + |
| 39 | + // CHECK-NO-SKIP: sil hidden{{.*}} @$s4Test11PublicClassCACycfC : $@convention(method) (@thick PublicClass.Type) -> @owned PublicClass { |
| 40 | + // CHECK-SKIP-NOT: s4Test11PublicClassCACycfC |
| 41 | + |
| 42 | + // CHECK-NO-SKIP: sil hidden{{.*}} @$s4Test11PublicClassCACycfc : $@convention(method) (@owned PublicClass) -> @owned PublicClass { |
| 43 | + // CHECK-SKIP-NOT: s4Test11PublicClassCACycfc |
| 44 | +} |
| 45 | + |
| 46 | +extension PublicClass { |
| 47 | + // CHECK-NO-SKIP: sil hidden{{.*}} @$s4Test11PublicClassC25internalMethodInExtensionyyF : $@convention(method) (@guaranteed PublicClass) -> () { |
| 48 | + // CHECK-SKIP-NOT: s4Test11PublicClassC25internalMethodInExtensionyyF |
| 49 | + internal func internalMethodInExtension() {} |
| 50 | +} |
| 51 | + |
| 52 | +// CHECK-NO-SKIP-LABEL: sil_vtable PrivateClass { |
| 53 | +// CHECK-NO-SKIP-NEXT: #PrivateClass.init!allocator |
| 54 | +// CHECK-NO-SKIP-NEXT: #PrivateClass.deinit!deallocator |
| 55 | +// CHECK-NO-SKIP-NEXT: } |
| 56 | +// CHECK-SKIP-NOT: sil_vtable PrivateClass |
| 57 | + |
| 58 | +// CHECK-LABEL: sil_vtable [serialized] PublicClass { |
| 59 | +// CHECK-NO-SKIP-NEXT: #PublicClass.internalMethod |
| 60 | +// CHECK-SKIP-NOT: #PublicClass.internalMethod |
| 61 | +// CHECK-NO-SKIP-NEXT: #PublicClass.init!allocator |
| 62 | +// CHECK-SKIP-NOT: #PublicClass.init!allocator |
| 63 | +// CHECK-NEXT: #PublicClass.deinit!deallocator |
| 64 | +// CHECK-NEXT: } |
0 commit comments