@@ -100,6 +100,7 @@ sil [ossa] @getT : $@convention(thin) <T> () -> @out T
100
100
sil [ossa] @getKlass : $@convention(thin) () -> (@owned Klass)
101
101
sil [ossa] @borrowKlass : $(@in_guaranteed Klass) -> ()
102
102
sil [ossa] @borrowT : $@convention(thin) <T> (@in_guaranteed T) -> ()
103
+ sil [ossa] @borrowMoveOnlyT : $@convention(thin) <T> (@in_guaranteed @moveOnly T) -> ()
103
104
sil [ossa] @getPair : $@convention(thin) <T> () -> @out Pair<T>
104
105
sil [ossa] @getOwned : $@convention(thin) <T : AnyObject> () -> (@owned T)
105
106
sil [ossa] @takeGuaranteedObject : $@convention(thin) (@guaranteed AnyObject) -> ()
@@ -2345,6 +2346,34 @@ exit:
2345
2346
return %retval : $()
2346
2347
}
2347
2348
2349
+ // CHECK-LABEL: sil [ossa] @test_copyable_to_moveonlywrapper_1_owned : {{.*}} {
2350
+ // CHECK: bb0([[TMO:%[^,]+]] :
2351
+ // CHECK: [[T:%[^,]+]] = copyable_to_moveonlywrapper_addr [[TMO]]
2352
+ // CHECK: destroy_addr [[T]]
2353
+ // CHECK-LABEL: } // end sil function 'test_copyable_to_moveonlywrapper_1_owned'
2354
+ sil [ossa] @test_copyable_to_moveonlywrapper_1_owned : $@convention(thin) <T> (@in T) -> () {
2355
+ entry(%t : @owned $T):
2356
+ %tmo = copyable_to_moveonlywrapper [owned] %t : $T
2357
+ destroy_value %tmo : $@moveOnly T
2358
+ %retval = tuple ()
2359
+ return %retval : $()
2360
+ }
2361
+
2362
+ // CHECK-LABEL: sil [ossa] @test_copyable_to_moveonlywrapper_2_guaranteed : {{.*}} {
2363
+ // CHECK: bb0([[TMO:%[^,]+]] :
2364
+ // CHECK: [[T:%[^,]+]] = copyable_to_moveonlywrapper_addr [[TMO]]
2365
+ // CHECK: [[BORROW_T:%[^,]+]] = function_ref @borrowMoveOnlyT
2366
+ // CHECK: apply [[BORROW_T]]<T>([[T]])
2367
+ // CHECK-LABEL: } // end sil function 'test_copyable_to_moveonlywrapper_2_guaranteed'
2368
+ sil [ossa] @test_copyable_to_moveonlywrapper_2_guaranteed : $@convention(thin) <T> (@in_guaranteed T) -> () {
2369
+ entry(%t : @guaranteed $T):
2370
+ %tmo = copyable_to_moveonlywrapper [guaranteed] %t : $T
2371
+ %borrowT = function_ref @borrowMoveOnlyT : $@convention(thin) <T> (@in_guaranteed @moveOnly T) -> ()
2372
+ apply %borrowT<T>(%tmo) : $@convention(thin) <T> (@in_guaranteed @moveOnly T) -> ()
2373
+ %retval = tuple ()
2374
+ return %retval : $()
2375
+ }
2376
+
2348
2377
enum PairEnum<T> {
2349
2378
case it(T, T)
2350
2379
}
@@ -2552,6 +2581,34 @@ entry(%t : @owned $@moveOnly T):
2552
2581
return %retval : $()
2553
2582
}
2554
2583
2584
+ // CHECK-LABEL: sil [ossa] @test_moveonlywrapper_to_copyable_1_owned : {{.*}} {
2585
+ // CHECK: bb0([[TMO:%[^,]+]] :
2586
+ // CHECK: [[T:%[^,]+]] = moveonlywrapper_to_copyable_addr [[TMO]]
2587
+ // CHECK: destroy_addr [[T]]
2588
+ // CHECK-LABEL: } // end sil function 'test_moveonlywrapper_to_copyable_1_owned'
2589
+ sil [ossa] @test_moveonlywrapper_to_copyable_1_owned : $@convention(thin) <T> (@in @moveOnly T) -> () {
2590
+ entry(%tmo : @owned $@moveOnly T):
2591
+ %t = moveonlywrapper_to_copyable [owned] %tmo : $@moveOnly T
2592
+ destroy_value %t : $T
2593
+ %retval = tuple ()
2594
+ return %retval : $()
2595
+ }
2596
+
2597
+ // CHECK-LABEL: sil [ossa] @test_moveonlywrapper_to_copyable_2_guaranteed : {{.*}} {
2598
+ // CHECK: bb0([[TMO:%[^,]+]] :
2599
+ // CHECK: [[T:%[^,]+]] = moveonlywrapper_to_copyable_addr [[TMO]]
2600
+ // CHECK: [[BORROW_T:%[^,]+]] = function_ref @borrowT
2601
+ // CHECK: apply [[BORROW_T]]<T>([[T]])
2602
+ // CHECK-LABEL: } // end sil function 'test_moveonlywrapper_to_copyable_2_guaranteed'
2603
+ sil [ossa] @test_moveonlywrapper_to_copyable_2_guaranteed : $@convention(thin) <T> (@in_guaranteed @moveOnly T) -> () {
2604
+ entry(%tmo : @guaranteed $@moveOnly T):
2605
+ %t = moveonlywrapper_to_copyable [guaranteed] %tmo : $@moveOnly T
2606
+ %borrowT = function_ref @borrowT : $@convention(thin) <T> (@in_guaranteed T) -> ()
2607
+ apply %borrowT<T>(%t) : $@convention(thin) <T> (@in_guaranteed T) -> ()
2608
+ %retval = tuple ()
2609
+ return %retval : $()
2610
+ }
2611
+
2555
2612
// CHECK-LABEL: sil [ossa] @test_open_pack_element_dominance : $@convention(thin) <each T> (@pack_guaranteed Pack{repeat each T}, Builtin.Word) -> () {
2556
2613
// CHECK: bb0([[PACK:%[^,]+]] :
2557
2614
// CHECK-SAME: [[RAW_INDEX:%[^,]+]] :
0 commit comments