Skip to content

Commit 9ceaa77

Browse files
committed
[Test] Check generated modify -> modify2 function.
1 parent 36fed87 commit 9ceaa77

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/SILGen/coroutine_accessors.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,29 @@ public var irm: Int {
6464
// CHECK: end_apply [[TOKEN]]
6565
// CHECK: end_access [[SELF_ACCESS]]
6666
// CHECK-LABEL:} // end sil function '$s19coroutine_accessors1SV3irmSivs'
67+
68+
// CHECK-LABEL: sil {{.*}}[ossa] @$s19coroutine_accessors1SV3irmSivM :
69+
// CHECK-SAME: $@yield_once
70+
// CHECK-SAME: @convention(method)
71+
// CHECK-SAME: (@inout S)
72+
// CHECK-SAME: ->
73+
// CHECK-SAME: @yields @inout Int
74+
// CHECK-SAME: {
75+
// CHECK: bb0(
76+
// CHECK-SAME: [[SELF:%[^,]+]] :
77+
// CHECK-SAME: ):
78+
// CHECK: [[SELF_ACCESS:%[^,]+]] = begin_access [modify] [unknown] [[SELF]]
79+
// CHECK: [[MODIFY_ACCESSOR:%[^,]+]] = function_ref @$s19coroutine_accessors1SV3irmSivx
80+
// CHECK: ([[VALUE_ADDRESS:%[^,]+]], [[TOKEN:%[^,]+]]) = begin_apply [[MODIFY_ACCESSOR]]([[SELF_ACCESS]])
81+
// CHECK: yield [[VALUE_ADDRESS:%[^,]+]] : $*Int, resume bb1, unwind bb2
82+
// CHECK: bb1:
83+
// CHECK: end_apply [[TOKEN]]
84+
// CHECK: end_access [[SELF_ACCESS]]
85+
// CHECK: bb2:
86+
// CHECK: end_apply [[TOKEN]]
87+
// CHECK: end_access [[SELF_ACCESS]]
88+
// CHECK: unwind
89+
// CHECK-LABEL: } // end sil function '$s19coroutine_accessors1SV3irmSivM'
6790
} // public var irm
6891

6992
} // public struct S

0 commit comments

Comments
 (0)