forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ivar_destroyer.sil
57 lines (46 loc) · 2.23 KB
/
ivar_destroyer.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
48
49
50
51
52
53
54
55
56
57
// RUN: %target-swift-frontend -emit-ir %s | FileCheck %s
// REQUIRES: CPU=x86_64
// REQUIRES: objc_interop
// CHECK: [[OBJCCLASS:%objc_class]] = type
// CHECK: [[OPAQUE:%swift.opaque]] = type opaque
// CHECK: [[TYPE:%swift.type]] = type
// CHECK: @_TMfC14ivar_destroyer17NonTrivialDerived = internal global { {{.*}} } {
// \ CHECK: i8* null,
// \ CHECK: i8** @_TWVBo,
// \ CHECK: i64 ptrtoint ([[OBJCCLASS]]* @_TMmC14ivar_destroyer17NonTrivialDerived to i64),
// \ CHECK: [[TYPE]]* bitcast (i64* getelementptr inbounds ({ {{.*}} }, { {{.*}} }* @_TMfC14ivar_destroyer11TrivialBase, i32 0, i32 2) to [[TYPE]]*),
// \ CHECK: [[OPAQUE]]* @_objc_empty_cache,
// \ CHECK: [[OPAQUE]]* null,
// \ CHECK: i64 add (i64 ptrtoint ({{.*}}* @_DATA__TtC14ivar_destroyer17NonTrivialDerived to i64), i64 1),
// \ CHECK: i32 3,
// \ CHECK: i32 0,
// \ CHECK: i32 24,
// \ CHECK: i16 7,
// \ CHECK: i16 0,
// \ CHECK: i32 120,
// \ CHECK: i32 16,
// \ CHECK: { {{.*}} }* @_TMnC14ivar_destroyer17NonTrivialDerived,
// \ CHECK: void (%C14ivar_destroyer17NonTrivialDerived*)* @_TFC14ivar_destroyer17NonTrivialDerivedE,
// \ CHECK: i8* bitcast (void ()* @swift_reportMissingMethod to i8*),
// \ CHECK: %C14ivar_destroyer17NonTrivialDerived* ([[TYPE]]*)* @alloc_NonTrivialDerived,
// \ CHECK: i64 16
// \ CHECK: }
class Pachyderm {}
sil_vtable Pachyderm {}
class TrivialBase {}
sil public_external @init_TrivialBase : $@convention(method) (@owned TrivialBase) -> @owned TrivialBase
sil_vtable TrivialBase {
#TrivialBase.init!initializer.1: init_TrivialBase
}
class NonTrivialDerived : TrivialBase {
let p: Pachyderm
required override init()
}
sil public_external @init_NonTrivialDerived : $@convention(method) (@owned NonTrivialDerived) -> @owned NonTrivialDerived
sil public_external @alloc_NonTrivialDerived : $@convention(thin) (@thick NonTrivialDerived.Type) -> @owned NonTrivialDerived
sil public_external @_TFC14ivar_destroyer17NonTrivialDerivedE : $@convention(method) (@guaranteed NonTrivialDerived) -> ()
sil_vtable NonTrivialDerived {
#NonTrivialDerived.init!initializer.1: init_NonTrivialDerived
#NonTrivialDerived.init!allocator.1: alloc_NonTrivialDerived
#NonTrivialDerived!ivardestroyer.1: _TFC14ivar_destroyer17NonTrivialDerivedE
}