@@ -235,6 +235,23 @@ class Subclass: Foo {
235
235
dynamic override func overriddenByDynamic( ) { }
236
236
}
237
237
238
+ class SubclassWithInheritedInits : Foo {
239
+ // CHECK-LABEL: sil hidden @_T07dynamic26SubclassWithInheritedInitsC{{[_0-9a-zA-Z]*}}fc
240
+ // CHECK: super_method [volatile] {{%.*}} : $SubclassWithInheritedInits, #Foo.init!initializer.1.foreign :
241
+ }
242
+ class GrandchildWithInheritedInits : SubclassWithInheritedInits {
243
+ // CHECK-LABEL: sil hidden @_T07dynamic28GrandchildWithInheritedInitsC{{[_0-9a-zA-Z]*}}fc
244
+ // CHECK: super_method [volatile] {{%.*}} : $GrandchildWithInheritedInits, #SubclassWithInheritedInits.init!initializer.1.foreign :
245
+ }
246
+ class GrandchildOfInheritedInits : SubclassWithInheritedInits {
247
+ // Dynamic methods are super-dispatched by objc_msgSend
248
+ override init ( dynamic: Int ) {
249
+ super. init ( dynamic: dynamic)
250
+ }
251
+ // CHECK-LABEL: sil hidden @_T07dynamic26GrandchildOfInheritedInitsC{{[_0-9a-zA-Z]*}}fc
252
+ // CHECK: super_method [volatile] {{%.*}} : $GrandchildOfInheritedInits, #SubclassWithInheritedInits.init!initializer.1.foreign :
253
+ }
254
+
238
255
// CHECK-LABEL: sil hidden @_T07dynamic20nativeMethodDispatchyyF : $@convention(thin) () -> ()
239
256
func nativeMethodDispatch( ) {
240
257
// CHECK: function_ref @_T07dynamic3{{[_0-9a-zA-Z]*}}fC
@@ -508,6 +525,25 @@ public class ConcreteDerived : GenericBase<Int> {
508
525
// CHECK: #Foo.overriddenByDynamic!1: {{.*}} : public _T07dynamic8SubclassC19overriddenByDynamic{{[_0-9a-zA-Z]*}}FTD
509
526
// CHECK: }
510
527
528
+ // Check vtables for implicitly-inherited initializers
529
+ // CHECK-LABEL: sil_vtable SubclassWithInheritedInits {
530
+ // CHECK: #Foo.init!initializer.1: (Foo.Type) -> (Int) -> Foo : _T07dynamic26SubclassWithInheritedInitsCACSi6native_tcfc
531
+ // CHECK: #Foo.init!initializer.1: (Foo.Type) -> (Int) -> Foo : _T07dynamic26SubclassWithInheritedInitsCACSi4objc_tcfc
532
+ // CHECK-NOT: .init!
533
+ // CHECK: }
534
+
535
+ // CHECK-LABEL: sil_vtable GrandchildWithInheritedInits {
536
+ // CHECK: #Foo.init!initializer.1: (Foo.Type) -> (Int) -> Foo : _T07dynamic28GrandchildWithInheritedInitsCACSi6native_tcfc
537
+ // CHECK: #Foo.init!initializer.1: (Foo.Type) -> (Int) -> Foo : _T07dynamic28GrandchildWithInheritedInitsCACSi4objc_tcfc
538
+ // CHECK-NOT: .init!
539
+ // CHECK: }
540
+
541
+ // CHECK-LABEL: sil_vtable GrandchildOfInheritedInits {
542
+ // CHECK: #Foo.init!initializer.1: (Foo.Type) -> (Int) -> Foo : _T07dynamic26GrandchildOfInheritedInitsCACSi6native_tcfc
543
+ // CHECK: #Foo.init!initializer.1: (Foo.Type) -> (Int) -> Foo : _T07dynamic26GrandchildOfInheritedInitsCACSi4objc_tcfc
544
+ // CHECK-NOT: .init!
545
+ // CHECK: }
546
+
511
547
// No vtable entry for override of @objc extension property
512
548
// CHECK-LABEL: sil_vtable SubExt {
513
549
// CHECK-NEXT: #BaseExt.init!initializer.1: (BaseExt.Type) -> () -> BaseExt : _T07dynamic6SubExtCACycfc // dynamic.SubExt.init() -> dynamic.SubExt
0 commit comments