Skip to content

Commit 055b326

Browse files
committed
Move utility function from Inputs/resilient_class.swift to single test that uses it
1 parent 5aa40dd commit 055b326

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

test/Inputs/resilient_class.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
public func doFoo(f: () -> ()) {
2-
f()
3-
}
4-
51
@_fixed_layout
62
public class OutsideParent {
73
public var property: String = "OutsideParent.property"

test/SILGen/partial_apply_super.swift

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
import resilient_class
77

8+
func doFoo(f: () -> ()) {
9+
f()
10+
}
11+
812
public class Parent {
913
public init() {}
1014
public func method() {}
@@ -26,7 +30,7 @@ public class GenericParent<A> {
2630

2731
class Child : Parent {
2832
// CHECK-LABEL: sil hidden @_TFC19partial_apply_super5Child6methodfT_T_ : $@convention(method) (@guaranteed Child) -> ()
29-
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF15resilient_class5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
33+
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF19partial_apply_super5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
3034
// CHECK: [[CASTED_SELF:%[0-9]+]] = upcast %0 : $Child to $Parent
3135
// CHECK: [[SUPER_METHOD:%[0-9]+]] = super_method %0 : $Child, #Parent.method!1 : (Parent) -> () -> () , $@convention(method) (@guaranteed Parent) -> ()
3236
// CHECK: [[PARTIAL_APPLY:%[0-9]+]] = partial_apply [[SUPER_METHOD]]([[CASTED_SELF]]) : $@convention(method) (@guaranteed Parent) -> ()
@@ -36,7 +40,7 @@ class Child : Parent {
3640
}
3741

3842
// CHECK-LABEL: sil hidden @_TZFC19partial_apply_super5Child11classMethodfT_T_ : $@convention(thin) (@thick Child.Type) -> () {
39-
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF15resilient_class5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
43+
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF19partial_apply_super5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
4044
// CHECK: [[CASTED_SELF:%[0-9]+]] = upcast %0 : $@thick Child.Type to $@thick Parent.Type
4145
// CHECK: [[SUPER_METHOD:%[0-9]+]] = super_method %0 : $@thick Child.Type, #Parent.classMethod!1 : (Parent.Type) -> () -> () , $@convention(thin) (@thick Parent.Type) -> ()
4246
// CHECK: [[PARTIAL_APPLY:%[0-9]+]] = partial_apply [[SUPER_METHOD]]([[CASTED_SELF]]) : $@convention(thin) (@thick Parent.Type) -> ()
@@ -46,7 +50,7 @@ class Child : Parent {
4650
}
4751

4852
// CHECK-LABEL: sil hidden @_TFC19partial_apply_super5Child20callFinalSuperMethodfT_T_ : $@convention(method) (@guaranteed Child) -> ()
49-
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF15resilient_class5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
53+
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF19partial_apply_super5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
5054
// CHECK: [[CASTED_SELF:%[0-9]+]] = upcast %0 : $Child to $Parent
5155
// CHECK: [[SUPER_METHOD:%[0-9]+]] = function_ref @_TFC19partial_apply_super6Parent11finalMethodFT_T_ : $@convention(thin) (@owned Parent) -> @owned @callee_owned () -> ()
5256
// CHECK: [[APPLIED_SELF:%[0-9]+]] = apply [[SUPER_METHOD]]([[CASTED_SELF]]) : $@convention(thin) (@owned Parent) -> @owned @callee_owned () -> ()
@@ -56,7 +60,7 @@ class Child : Parent {
5660
}
5761

5862
// CHECK-LABEL: sil hidden @_TZFC19partial_apply_super5Child25callFinalSuperClassMethodfT_T_ : $@convention(thin) (@thick Child.Type) -> ()
59-
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF15resilient_class5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
63+
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF19partial_apply_super5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
6064
// CHECK: [[CASTED_SELF:%[0-9]+]] = upcast %0 : $@thick Child.Type to $@thick Parent.Type
6165
// CHECK: [[SUPER_METHOD:%[0-9]+]] = function_ref @_TZFC19partial_apply_super6Parent16finalClassMethodFT_T_ : $@convention(thin) (@thick Parent.Type) -> @owned @callee_owned () -> ()
6266
// CHECK: [[APPLIED_SELF:%[0-9]+]] = apply [[SUPER_METHOD]]([[CASTED_SELF]]) : $@convention(thin) (@thick Parent.Type) -> @owned @callee_owned () -> ()
@@ -71,7 +75,7 @@ class GenericChild<A> : GenericParent<A> {
7175
super.init(a: a)
7276
}
7377
// CHECK-LABEL: sil hidden @_TFC19partial_apply_super12GenericChild6methodfT_T_ : $@convention(method) <A> (@guaranteed GenericChild<A>) -> ()
74-
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF15resilient_class5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
78+
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF19partial_apply_super5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
7579
// CHECK: [[CASTED_SELF:%[0-9]+]] = upcast %0 : $GenericChild<A> to $GenericParent<A>
7680
// CHECK: [[SUPER_METHOD:%[0-9]+]] = super_method %0 : $GenericChild<A>, #GenericParent.method!1 : <A> (GenericParent<A>) -> () -> () , $@convention(method) <τ_0_0> (@guaranteed GenericParent<τ_0_0>) -> ()
7781
// CHECK: [[PARTIAL_APPLY:%[0-9]+]] = partial_apply [[SUPER_METHOD]]<A>([[CASTED_SELF]]) : $@convention(method) <τ_0_0> (@guaranteed GenericParent<τ_0_0>) -> ()
@@ -81,7 +85,7 @@ class GenericChild<A> : GenericParent<A> {
8185
}
8286

8387
// CHECK-LABEL: sil hidden @_TZFC19partial_apply_super12GenericChild11classMethodfT_T_ : $@convention(thin) <A> (@thick GenericChild<A>.Type) -> ()
84-
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF15resilient_class5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
88+
// CHECK: [[DOFOO:%[0-9]+]] = function_ref @_TF19partial_apply_super5doFooFFT_T_T_ : $@convention(thin) (@owned @callee_owned () -> ()) -> ()
8589
// CHECK: [[CASTED_SELF:%[0-9]+]] = upcast %0 : $@thick GenericChild<A>.Type to $@thick GenericParent<A>.Type
8690
// CHECK: [[SUPER_METHOD:%[0-9]+]] = super_method %0 : $@thick GenericChild<A>.Type, #GenericParent.classMethod!1 : <A> (GenericParent<A>.Type) -> () -> () , $@convention(thin) <τ_0_0> (@thick GenericParent<τ_0_0>.Type) -> ()
8791
// CHECK: [[PARTIAL_APPLY:%[0-9]+]] = partial_apply %4<A>(%3) : $@convention(thin) <τ_0_0> (@thick GenericParent<τ_0_0>.Type) -> ()

0 commit comments

Comments
 (0)