@@ -160,6 +160,52 @@ mutating func update(irm newValue: Int) throws -> Int {
160
160
try coroutine_accessors. update ( at: & irm, to: newValue)
161
161
}
162
162
163
+ public var i_r_m : Int {
164
+ // CHECK-LABEL: sil{{.*}} [ossa] @$s19coroutine_accessors1SV5i_r_mSivr :
165
+ // CHECK-SAME: $@yield_once
166
+ // CHECK-SAME: @convention(method)
167
+ // CHECK-SAME: (@guaranteed S)
168
+ // CHECK-SAME: ->
169
+ // CHECK-SAME: @yields Int
170
+ // CHECK-SAME: {
171
+ // CHECK: } // end sil function '$s19coroutine_accessors1SV5i_r_mSivr'
172
+
173
+ _read {
174
+ yield _i
175
+ }
176
+ // CHECK-NOT: sil [ossa] @$s19coroutine_accessors1SV5i_r_mSivx :
177
+ // CHECK-LABEL: sil {{.*}}[ossa] @$s19coroutine_accessors1SV5i_r_mSivM :
178
+ // CHECK-SAME: $@yield_once
179
+ // CHECK-SAME: @convention(method)
180
+ // CHECK-SAME: (@inout S)
181
+ // CHECK-SAME: ->
182
+ // CHECK-SAME: @yields @inout Int
183
+ // CHECK-SAME: {
184
+ // CHECK: } // end sil function '$s19coroutine_accessors1SV5i_r_mSivM'
185
+ _modify {
186
+ yield & _i
187
+ }
188
+ // CHECK-LABEL: sil {{.*}}[ossa] @$s19coroutine_accessors1SV5i_r_mSivs :
189
+ // CHECK-SAME: $@convention(method)
190
+ // CHECK-SAME: (Int, @inout S)
191
+ // CHECK-SAME: ->
192
+ // CHECK-SAME: ()
193
+ // CHECK-SAME: {
194
+ // CHECK: bb0(
195
+ // CHECK-SAME: [[NEW_VALUE:%[^,]+]] :
196
+ // CHECK-SAME: [[SELF:%[^,]+]] :
197
+ // CHECK-SAME: ):
198
+ // CHECK: [[SELF_ACCESS:%[^,]+]] = begin_access [modify] [unknown] [[SELF]]
199
+ // CHECK: [[MODIFY_ACCESSOR:%[^,]+]] = function_ref @$s19coroutine_accessors1SV5i_r_mSivM
200
+ // CHECK: ([[VALUE_ADDRESS:%[^,]+]],
201
+ // CHECK-SAME: [[TOKEN:%[^)]+]])
202
+ // CHECK-SAME: = begin_apply [[MODIFY_ACCESSOR]]([[SELF_ACCESS]])
203
+ // CHECK: assign [[NEW_VALUE:%[^,]+]] to [[VALUE_ADDRESS]]
204
+ // CHECK: end_apply [[TOKEN]]
205
+ // CHECK: end_access [[SELF_ACCESS]]
206
+ // CHECK-LABEL:} // end sil function '$s19coroutine_accessors1SV5i_r_mSivs'
207
+ } // public var irm
208
+
163
209
} // public struct S
164
210
165
211
enum E : Error {
0 commit comments