@@ -51,6 +51,7 @@ sil @initX : $@convention(method) (@owned X) -> @owned X {
51
51
[%0: escape => %r, escape c*.v** => %r.c*.v**]
52
52
}
53
53
sil @modifyStr : $@convention(method) (@inout Str) -> ()
54
+ sil @guaranteed_yield_coroutine : $@yield_once @convention(thin) (@inout X) -> @yields @inout X
54
55
55
56
// CHECK-LABEL: Address escape information for test_simple:
56
57
// CHECK: value: %1 = struct_element_addr %0 : $*Str, #Str.a
@@ -268,6 +269,28 @@ bb0:
268
269
return %12 : $()
269
270
}
270
271
272
+ // CHECK-LABEL: Address escape information for indirect_argument_escape_to_yield:
273
+ // CHECK: value: %1 = alloc_stack $X
274
+ // CHECK-NEXT: ==> (%5, %6) = begin_apply %4(%1) : $@yield_once @convention(thin) (@inout X) -> @yields @inout X
275
+ // CHECK-NEXT: ==> %8 = apply %7(%5) : $@convention(thin) (@inout X) -> ()
276
+ // CHECK: End function indirect_argument_escape_to_yield
277
+ sil @indirect_argument_escape_to_yield : $@convention(thin) (@guaranteed X) -> () {
278
+ bb0(%0 : $X):
279
+ %1 = alloc_stack $X
280
+ store %0 to %1 : $*X
281
+ fix_lifetime %1 : $*X
282
+ %3 = function_ref @guaranteed_yield_coroutine : $@yield_once @convention(thin) (@inout X) -> @yields @inout X
283
+ (%4, %5) = begin_apply %3(%1) : $@yield_once @convention(thin) (@inout X) -> @yields @inout X
284
+
285
+ %6 = function_ref @inout_class_argument : $@convention(thin) (@inout X) -> ()
286
+ %7 = apply %6(%4) : $@convention(thin) (@inout X) -> ()
287
+
288
+ end_apply %5
289
+ dealloc_stack %1 : $*X
290
+ %r = tuple ()
291
+ return %r : $()
292
+ }
293
+
271
294
// CHECK-LABEL: Address escape information for ignore_copy_addr_and_release:
272
295
// CHECK: value: %1 = ref_element_addr %0 : $X, #X.s
273
296
// CHECK-NEXT: - %6 = apply %5(%3) : $@convention(thin) (@in Str) -> ()
0 commit comments