@@ -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
}
0 commit comments