@@ -369,6 +369,59 @@ bb1:
369
369
ret void
370
370
}
371
371
372
+ ; CHECK-LABEL: @releasemotion_forwarding
373
+ ; CHECK-NOT: swift_retain
374
+ ; CHECK-NOT: swift_release
375
+ ; CHECK: call void @user(%swift.refcounted* %P)
376
+ ; CHECK: ret
377
+ define void @releasemotion_forwarding (%swift.refcounted* %P , i8* %O , %swift.bridge* %B ) {
378
+ entry:
379
+ %res = tail call %swift.refcounted* @swift_retain (%swift.refcounted* %P )
380
+ tail call void @swift_release (%swift.refcounted* %res ) nounwind
381
+ call void @user (%swift.refcounted* %res ) nounwind
382
+ ret void
383
+ }
384
+
385
+ ; CHECK-LABEL: @retainmotion_forwarding
386
+ ; CHECK: store %swift.refcounted* %P, %swift.refcounted** %R, align 4
387
+ ; CHECK-NOT: swift_retain
388
+ ; CHECK-NOT: swift_release
389
+ ; CHECK: ret
390
+ define void @retainmotion_forwarding (%swift.refcounted* %P , %swift.refcounted** %R , %swift.bridge* %B ) {
391
+ entry:
392
+ %res = tail call %swift.refcounted* @swift_retain (%swift.refcounted* %P )
393
+ store %swift.refcounted* %res , %swift.refcounted** %R , align 4
394
+ call void @swift_bridgeObjectRelease (%swift.bridge* %B )
395
+ tail call void @swift_release (%swift.refcounted* %res ) nounwind
396
+ ret void
397
+ }
398
+
399
+ ; CHECK-LABEL: @unknownreleasemotion_forwarding
400
+ ; CHECK-NOT: swift_unknownObjectRetain
401
+ ; CHECK-NOT: swift_unknownObjectRelease
402
+ ; CHECK: call void @user(%swift.refcounted* %P)
403
+ ; CHECK: ret
404
+ define void @unknownreleasemotion_forwarding (%swift.refcounted* %P , i8* %O , %swift.bridge* %B ) {
405
+ entry:
406
+ %res = tail call %swift.refcounted* @swift_unknownObjectRetain (%swift.refcounted* %P )
407
+ tail call void @swift_unknownObjectRelease (%swift.refcounted* %res ) nounwind
408
+ call void @user (%swift.refcounted* %res ) nounwind
409
+ ret void
410
+ }
411
+
412
+ ; CHECK-LABEL: @unknownretainmotion_forwarding
413
+ ; CHECK: store %swift.refcounted* %P, %swift.refcounted** %R, align 4
414
+ ; CHECK-NOT: swift_unknownObjectRetain
415
+ ; CHECK-NOT: swift_unknownObjectRelease
416
+ ; CHECK: ret
417
+ define void @unknownretainmotion_forwarding (%swift.refcounted* %P , %swift.refcounted** %R , %swift.bridge* %B ) {
418
+ entry:
419
+ %res = tail call %swift.refcounted* @swift_unknownObjectRetain (%swift.refcounted* %P )
420
+ store %swift.refcounted* %res , %swift.refcounted** %R , align 4
421
+ call void @swift_bridgeObjectRelease (%swift.bridge* %B )
422
+ tail call void @swift_unknownObjectRelease (%swift.refcounted* %res ) nounwind
423
+ ret void
424
+ }
372
425
373
426
!llvm.dbg.cu = !{!1 }
374
427
!llvm.module.flags = !{!4 }
0 commit comments