mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Validate that inherited entries are not left at "normal" state, and that non-overridden entries do not in fact have overrides.
48 lines
1.1 KiB
Plaintext
48 lines
1.1 KiB
Plaintext
// RUN: %target-sil-opt -sil-deadfuncelim %s | %FileCheck %s
|
|
|
|
// Check that we don't crash on this.
|
|
|
|
sil_stage canonical
|
|
|
|
import Builtin
|
|
import Swift
|
|
import SwiftShims
|
|
|
|
private class Base {
|
|
init()
|
|
}
|
|
|
|
private class Derived : Base {
|
|
}
|
|
|
|
sil private @BaseInit : $@convention(method) (@thick Base.Type) -> @owned Base {
|
|
bb0(%4 : $@thick Base.Type):
|
|
return undef : $Base
|
|
}
|
|
|
|
sil private @DerivedInit : $@convention(method) (@thick Derived.Type) -> @owned Derived {
|
|
bb0(%4 : $@thick Derived.Type):
|
|
return undef : $Derived
|
|
}
|
|
|
|
sil @testit : $@convention(method) (@thick Derived.Type) -> @thick Derived.Type {
|
|
bb0(%1 : $@thick Derived.Type):
|
|
%157 = class_method %1 : $@thick Derived.Type, #Derived.init!allocator : (Derived.Type) -> () -> Derived, $@convention(method) (@thick Derived.Type) -> @owned Derived
|
|
return %1 : $@thick Derived.Type
|
|
}
|
|
|
|
sil_vtable Base {
|
|
#Base.init!allocator: @BaseInit
|
|
}
|
|
|
|
sil_vtable Derived {
|
|
#Base.init!allocator: @DerivedInit [override]
|
|
}
|
|
|
|
|
|
// CHECK-LABEL: sil_vtable Base
|
|
// CHECK-: BaseInit
|
|
|
|
// CHECK-LABEL: sil_vtable Derived
|
|
// CHECK: DerivedInit
|