Skip to content

Commit b4e1c48

Browse files
committed
Tests: Add serialization of vtable for package class tests.
Missing from #70100.
1 parent 857c2c3 commit b4e1c48

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package class Base {
2+
package func packageMethod() {}
3+
internal func internalMethod() {}
4+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: %target-swift-frontend -emit-silgen %S/Inputs/accessibility_vtables_package_helper.swift -package-name Package | %FileCheck %s --check-prefix=LIBRARY
4+
// RUN: %target-swift-frontend -enable-library-evolution -emit-silgen %S/Inputs/accessibility_vtables_package_helper.swift -package-name Package | %FileCheck %s --check-prefix=LIBRARY
5+
6+
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/accessibility_vtables_package_helper.swift -package-name Package
7+
// RUN: %target-swift-emit-silgen -primary-file %s -I %t -package-name Package | %FileCheck %s --check-prefix=CLIENT
8+
9+
// RUN: %target-swift-frontend -enable-library-evolution -emit-module -o %t %S/Inputs/accessibility_vtables_package_helper.swift -package-name Package
10+
// RUN: %target-swift-emit-silgen -primary-file %s -I %t -package-name Package | %FileCheck %s --check-prefix=CLIENT
11+
12+
import accessibility_vtables_package_helper
13+
14+
// LIBRARY-LABEL: sil_vtable Base {
15+
// LIBRARY-NEXT: #Base.packageMethod: (Base) -> () -> () : @$s36accessibility_vtables_package_helper4BaseC0C6MethodyyF
16+
// LIBRARY-NEXT: #Base.internalMethod: (Base) -> () -> () : @$s36accessibility_vtables_package_helper4BaseC14internalMethodyyF
17+
// LIBRARY-NEXT: #Base.init!allocator: (Base.Type) -> () -> Base : @$s36accessibility_vtables_package_helper4BaseCACycfC
18+
// LIBRARY-NEXT: #Base.deinit!deallocator: @$s36accessibility_vtables_package_helper4BaseCfD
19+
// LIBRARY-NEXT: }
20+
21+
// CLIENT-LABEL: sil hidden [ossa] @$s29accessibility_vtables_package15usePackageClassyy0a1_b1_C7_helper4BaseCF : $@convention(thin) (@guaranteed Base) -> () {
22+
func usePackageClass(_ c: Base) {
23+
c.packageMethod()
24+
}
25+
26+
// TODO: If cross-module inheritance from package visibility superclasses ever becomes a thing,
27+
// test serialization of the vtable for the derived class in this file.

0 commit comments

Comments
 (0)