Skip to content

Commit ce549d7

Browse files
committed
Update test/SILGen/auto_generated_super_init_call.swift for native super dispatch
NFC.
1 parent 9f43fcd commit ce549d7

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

test/SILGen/auto_generated_super_init_call.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-silgen %s | FileCheck %s
1+
// RUN: %target-swift-frontend -use-native-super-method -emit-silgen %s | FileCheck %s
22

33
// Test that we emit a call to super.init at the end of the initializer, when none has been previously added.
44

@@ -16,8 +16,7 @@ class SomeDerivedClass : Parent {
1616
// CHECK: integer_literal $Builtin.Int2048, 42
1717
// CHECK: [[SELFLOAD:%[0-9]+]] = load [[SELF:%[0-9]+]] : $*SomeDerivedClass
1818
// CHECK-NEXT: [[PARENT:%[0-9]+]] = upcast [[SELFLOAD]] : $SomeDerivedClass to $Parent
19-
// CHECK-NEXT: function_ref auto_generated_super_init_call.Parent.init
20-
// CHECK-NEXT: [[INITCALL1:%[0-9]+]] = function_ref @_TFC30auto_generated_super_init_call6Parentc
19+
// CHECK-NEXT: [[INITCALL1:%[0-9]+]] = super_method [[SELFLOAD]] : $SomeDerivedClass, #Parent.init!initializer.1
2120
// CHECK-NEXT: [[RES1:%[0-9]+]] = apply [[INITCALL1]]([[PARENT]])
2221
// CHECK-NEXT: [[DOWNCAST:%[0-9]+]] = unchecked_ref_cast [[RES1]] : $Parent to $SomeDerivedClass
2322
// CHECK-NEXT: store [[DOWNCAST]] to [[SELF]] : $*SomeDerivedClass
@@ -26,7 +25,7 @@ class SomeDerivedClass : Parent {
2625
init(x: Int) {
2726
y = x
2827
// CHECK-LABEL: sil hidden @_TFC30auto_generated_super_init_call16SomeDerivedClassc{{.*}} : $@convention(method) (Int, @owned SomeDerivedClass) -> @owned SomeDerivedClass
29-
// CHECK: function_ref @_TFC30auto_generated_super_init_call6Parentc{{.*}} : $@convention(method) (@owned Parent) -> @owned Parent
28+
// CHECK: super_method {{%[0-9]+}} : $SomeDerivedClass, #Parent.init!initializer.1 : Parent.Type -> () -> Parent , $@convention(method) (@owned Parent) -> @owned Parent
3029
}
3130

3231
init(b: Bool) {
@@ -42,7 +41,7 @@ class SomeDerivedClass : Parent {
4241
// CHECK-LABEL: sil hidden @_TFC30auto_generated_super_init_call16SomeDerivedClassc{{.*}} : $@convention(method) (Bool, @owned SomeDerivedClass) -> @owned SomeDerivedClass
4342
// CHECK: bb4:
4443
// CHECK: [[SELFLOAD:%[0-9]+]] = load [[SELF:%[0-9]+]] : $*SomeDerivedClass
45-
// CHECK: function_ref @_TFC30auto_generated_super_init_call6Parentc{{.*}} : $@convention(method) (@owned Parent) -> @owned Parent
44+
// CHECK: super_method [[SELFLOAD]] : $SomeDerivedClass, #Parent.init!initializer.1 : Parent.Type -> () -> Parent , $@convention(method) (@owned Parent) -> @owned Parent
4645
// CHECK-NEXT: apply
4746
// CHECK-NEXT: unchecked_ref_cast
4847
// CHECK-NEXT: store
@@ -62,7 +61,7 @@ class SomeDerivedClass : Parent {
6261

6362
super.init()
6463
// CHECK-LABEL: sil hidden @_TFC30auto_generated_super_init_call16SomeDerivedClassc{{.*}} : $@convention(method) (Bool, Int, @owned SomeDerivedClass) -> @owned SomeDerivedClass
65-
// CHECK: function_ref @_TFC30auto_generated_super_init_call6Parentc{{.*}} : $@convention(method) (@owned Parent) -> @owned Parent
64+
// CHECK: super_method {{%[0-9]+}} : $SomeDerivedClass, #Parent.init!initializer.1 : Parent.Type -> () -> Parent , $@convention(method) (@owned Parent) -> @owned Parent
6665
// CHECK-NOT: function_ref @_TFC30auto_generated_super_init_call6Parentc
6766
// CHECK: return
6867
}
@@ -72,7 +71,7 @@ class SomeDerivedClass : Parent {
7271
class HasNoIVars : Parent {
7372
override init() {
7473
// CHECK-LABEL: sil hidden @_TFC30auto_generated_super_init_call10HasNoIVarsc{{.*}} : $@convention(method) (@owned HasNoIVars) -> @owned HasNoIVars
75-
// CHECK: function_ref @_TFC30auto_generated_super_init_call6Parentc
74+
// CHECK: super_method {{%[0-9]+}} : $HasNoIVars, #Parent.init!initializer.1
7675
}
7776
}
7877

@@ -96,7 +95,7 @@ class ChildOfParentWithNoExplicitInit : ParentWithNoExplicitInit {
9695
override init() {
9796
y = 10
9897
// CHECK-LABEL: sil hidden @_TFC30auto_generated_super_init_call31ChildOfParentWithNoExplicitInitc
99-
// CHECK: function_ref @_TFC30auto_generated_super_init_call24ParentWithNoExplicitInitc{{.*}} : $@convention(method) (@owned ParentWithNoExplicitInit) -> @owned ParentWithNoExplicitInit
98+
// CHECK: super_method {{%[0-9]+}} : $ChildOfParentWithNoExplicitInit, #ParentWithNoExplicitInit.init!initializer.1 : ParentWithNoExplicitInit.Type -> () -> ParentWithNoExplicitInit , $@convention(method) (@owned ParentWithNoExplicitInit) -> @owned ParentWithNoExplicitInit
10099
}
101100
}
102101

@@ -110,7 +109,7 @@ class ChildOfParentWithNoExplicitInit2 : ParentWithNoExplicitInit2 {
110109
override init() {
111110
y = 10
112111
// CHECK-LABEL: sil hidden @_TFC30auto_generated_super_init_call32ChildOfParentWithNoExplicitInit2c
113-
// CHECK: function_ref @_TFC30auto_generated_super_init_call25ParentWithNoExplicitInit2c{{.*}} : $@convention(method) (@owned ParentWithNoExplicitInit2) -> @owned ParentWithNoExplicitInit2
112+
// CHECK: super_method {{%[0-9]+}} : $ChildOfParentWithNoExplicitInit2, #ParentWithNoExplicitInit2.init!initializer.1 : ParentWithNoExplicitInit2.Type -> () -> ParentWithNoExplicitInit2 , $@convention(method) (@owned ParentWithNoExplicitInit2) -> @owned ParentWithNoExplicitInit2
114113
}
115114
}
116115

0 commit comments

Comments
 (0)