@@ -23,6 +23,7 @@ struct M4: ~Copyable {
23
23
24
24
sil @get_M4 : $@convention(thin) () -> @owned M4
25
25
sil @end_2 : $@convention(thin) (@owned M, @owned M) -> ()
26
+ sil @see_addr : $@convention(thin) (@in_guaranteed M) -> ()
26
27
sil @see_addr_2 : $@convention(thin) (@in_guaranteed M, @in_guaranteed M) -> ()
27
28
sil @replace_2 : $@convention(thin) (@inout M, @inout M) -> ()
28
29
sil @get_out_2 : $@convention(thin) () -> (@out M, @out M)
@@ -235,3 +236,20 @@ bb0(%m_in : @owned $M):
235
236
apply %die(%pa) : $@convention(thin) (@guaranteed @noescape @callee_guaranteed () -> @owned String) -> Never
236
237
unreachable
237
238
}
239
+
240
+ // CHECK-LABEL: sil [ossa] @dont_destroy_store_borrowed_addr : {{.*}} {
241
+ // CHECK-NOT: destroy_addr
242
+ // CHECK-LABEL: } // end sil function 'dont_destroy_store_borrowed_addr'
243
+ sil [ossa] @dont_destroy_store_borrowed_addr : $@convention(thin) (@guaranteed M) -> () {
244
+ bb0(%0 : @guaranteed $M):
245
+ %stack = alloc_stack $M
246
+ %mark = mark_unresolved_non_copyable_value [consumable_and_assignable] %stack : $*M
247
+ %borrow = store_borrow %0 to %mark : $*M
248
+ %see_addr = function_ref @see_addr : $@convention(thin) (@in_guaranteed M) -> ()
249
+ apply %see_addr(%borrow) : $@convention(thin) (@in_guaranteed M) -> ()
250
+ end_borrow %borrow : $*M
251
+ dealloc_stack %stack : $*M
252
+ %retval = tuple ()
253
+ return %retval : $()
254
+ }
255
+
0 commit comments