forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdead_func_init_method.sil
47 lines (34 loc) · 995 Bytes
/
dead_func_init_method.sil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// 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 {
private init()
}
private class Derived : Base {
}
sil private @BaseInit : $@convention(method) (@owned Base) -> @owned Base {
bb0(%4 : $Base):
return %4 : $Base
}
sil private @DerivedInit : $@convention(method) (@owned Derived) -> @owned Derived {
bb0(%4 : $Derived):
return %4 : $Derived
}
sil @testit : $@convention(method) (@owned Derived) -> @owned Derived {
bb0(%1 : $Derived):
%157 = class_method %1 : $Derived, #Derived.init!initializer.1 : Derived.Type -> () -> Derived , $@convention(method) (@owned Derived) -> @owned Derived
return %1 : $Derived
}
sil_vtable Base {
#Base.init!initializer.1: BaseInit
}
sil_vtable Derived {
#Base.init!initializer.1: DerivedInit
}
// CHECK-LABEL: sil_vtable Base
// CHECK-: BaseInit
// CHECK-LABEL: sil_vtable Derived
// CHECK: DerivedInit