blob: 1bd8d637fa4fc05b15fad297f81944c2bdaaf2cd [file] [log] [blame]
// 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.1 : (Derived.Type) -> () -> Derived, $@convention(method) (@thick Derived.Type) -> @owned Derived
return %1 : $@thick Derived.Type
}
sil_vtable Base {
#Base.init!allocator.1: @BaseInit
}
sil_vtable Derived {
#Base.init!allocator.1: @DerivedInit
}
// CHECK-LABEL: sil_vtable Base
// CHECK-: BaseInit
// CHECK-LABEL: sil_vtable Derived
// CHECK: DerivedInit