@@ -2552,6 +2552,34 @@ entry(%t : @owned $@moveOnly T):
2552
2552
return %retval : $()
2553
2553
}
2554
2554
2555
+ // CHECK-LABEL: sil [ossa] @test_moveonlywrapper_to_copyable_1_owned : {{.*}} {
2556
+ // CHECK: bb0([[TMO:%[^,]+]] :
2557
+ // CHECK: [[T:%[^,]+]] = moveonlywrapper_to_copyable_addr [[TMO]]
2558
+ // CHECK: destroy_addr [[T]]
2559
+ // CHECK-LABEL: } // end sil function 'test_moveonlywrapper_to_copyable_1_owned'
2560
+ sil [ossa] @test_moveonlywrapper_to_copyable_1_owned : $@convention(thin) <T> (@in @moveOnly T) -> () {
2561
+ entry(%tmo : @owned $@moveOnly T):
2562
+ %t = moveonlywrapper_to_copyable [owned] %tmo : $@moveOnly T
2563
+ destroy_value %t : $T
2564
+ %retval = tuple ()
2565
+ return %retval : $()
2566
+ }
2567
+
2568
+ // CHECK-LABEL: sil [ossa] @test_moveonlywrapper_to_copyable_2_guaranteed : {{.*}} {
2569
+ // CHECK: bb0([[TMO:%[^,]+]] :
2570
+ // CHECK: [[T:%[^,]+]] = moveonlywrapper_to_copyable_addr [[TMO]]
2571
+ // CHECK: [[BORROW_T:%[^,]+]] = function_ref @borrowT
2572
+ // CHECK: apply [[BORROW_T]]<T>([[T]])
2573
+ // CHECK-LABEL: } // end sil function 'test_moveonlywrapper_to_copyable_2_guaranteed'
2574
+ sil [ossa] @test_moveonlywrapper_to_copyable_2_guaranteed : $@convention(thin) <T> (@in_guaranteed @moveOnly T) -> () {
2575
+ entry(%tmo : @guaranteed $@moveOnly T):
2576
+ %t = moveonlywrapper_to_copyable [guaranteed] %tmo : $@moveOnly T
2577
+ %borrowT = function_ref @borrowT : $@convention(thin) <T> (@in_guaranteed T) -> ()
2578
+ apply %borrowT<T>(%t) : $@convention(thin) <T> (@in_guaranteed T) -> ()
2579
+ %retval = tuple ()
2580
+ return %retval : $()
2581
+ }
2582
+
2555
2583
// CHECK-LABEL: sil [ossa] @test_open_pack_element_dominance : $@convention(thin) <each T> (@pack_guaranteed Pack{repeat each T}, Builtin.Word) -> () {
2556
2584
// CHECK: bb0([[PACK:%[^,]+]] :
2557
2585
// CHECK-SAME: [[RAW_INDEX:%[^,]+]] :
0 commit comments