// 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