@@ -40,6 +40,26 @@ sil @getSomeOptionalClass : $@convention(thin) () -> Optional<SomeClass>
40
40
// Tests //
41
41
///////////
42
42
43
+ // This can be generated by using:
44
+ //
45
+ // func makesInt() -> Int { return 0 }
46
+ // func takesIntInout(i: inout Int) -> () {}
47
+ //
48
+ // class RootClassWithIVars {
49
+ // var x: Int
50
+ // var y: Int
51
+ // var z: (Int, Int)
52
+ // init() {
53
+ // }
54
+ // }
55
+ //
56
+ // class DerivedClassWithIVars : RootClassWithIVars {
57
+ // var a: Int
58
+ // override init() {
59
+ // a = makesInt()
60
+ // }
61
+ // }
62
+ //
43
63
sil @derived_test1 : $@convention(method) (@owned DerivedClassWithIVars) -> @owned DerivedClassWithIVars {
44
64
bb0(%0 : $DerivedClassWithIVars):
45
65
%1 = alloc_box $<τ_0_0> { var τ_0_0 } <DerivedClassWithIVars>
@@ -70,6 +90,24 @@ bb0(%0 : $DerivedClassWithIVars):
70
90
return %18 : $DerivedClassWithIVars
71
91
}
72
92
93
+ // This is testing the following swift:
94
+ //
95
+ // func makesInt() -> Int { return 0 }
96
+ // func takesIntInout(i: inout Int) -> () {}
97
+ //
98
+ // class RootClassWithIVars {
99
+ // var x: Int
100
+ // var y: Int
101
+ // var z: (Int, Int)
102
+ // init() {
103
+ // }
104
+ // }
105
+ //
106
+ // class DerivedClassWithIVars : RootClassWithIVars {
107
+ // var a: Int
108
+ // override init() {
109
+ // }
110
+ // }
73
111
sil @derived_test2 : $@convention(method) (@owned DerivedClassWithIVars) -> @owned DerivedClassWithIVars {
74
112
bb0(%0 : $DerivedClassWithIVars):
75
113
%1 = alloc_box $<τ_0_0> { var τ_0_0 } <DerivedClassWithIVars>
@@ -167,6 +205,21 @@ bb0(%0 : $DerivedClassWithNontrivialStoredProperties):
167
205
}
168
206
169
207
// <rdar://problem/18199087> DI doesn't catch use of super properties lexically inside super.init call
208
+ //
209
+ // To recreate this:
210
+ //
211
+ // class Foo {
212
+ // var x: Int
213
+ // init() {}
214
+ // init(i: Int) {}
215
+ // }
216
+ //
217
+ // class Foo2 : Foo {
218
+ // override init() {
219
+ // super.init(i: self.x) // <--- The important part.
220
+ // }
221
+ // }
222
+ //
170
223
sil @super_init_out_of_order : $@convention(method) (@owned DerivedClassWithIVars, Int) -> @owned DerivedClassWithIVars {
171
224
bb0(%0 : $DerivedClassWithIVars, %i : $Int):
172
225
%1 = alloc_box $<τ_0_0> { var τ_0_0 } <DerivedClassWithIVars>
0 commit comments