Skip to content

Commit 9ab1628

Browse files
committed
[Test] Add a SILGen test for dynamic Self in parameter position.
1 parent 6cff3aa commit 9ab1628

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/SILGen/dynamic_self.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,17 @@ public class CaptureTwoValuesTest {
519519
}
520520
}
521521

522+
523+
final class Final {
524+
static func useSelf(_ body: (Self) -> ()) {}
525+
}
526+
527+
// CHECK-LABEL: sil hidden [ossa] @$s12dynamic_self13testNoErasureyyyAA5FinalCXEF : $@convention(thin) (@noescape @callee_guaranteed (@guaranteed Final) -> ()) -> () {
528+
func testNoErasure(_ body: (Final) -> ()) {
529+
// CHECK: function_ref @$s12dynamic_self5FinalC7useSelfyyyACXDXEFZ : $@convention(method) (@noescape @callee_guaranteed (@guaranteed Final) -> (), @thick Final.Type) -> ()
530+
return Final.useSelf(body)
531+
}
532+
522533
// CHECK-LABEL: sil_witness_table hidden X: P module dynamic_self {
523534
// CHECK: method #P.f: {{.*}} : @$s12dynamic_self1XCAA1PA2aDP1f{{[_0-9a-zA-Z]*}}FTW
524535

0 commit comments

Comments
 (0)