@@ -48,6 +48,12 @@ sil @non_escaping_class_argument : $@convention(thin) (@guaranteed X) -> () {
4848sil @inout_class_argument : $@convention(thin) (@inout X) -> () {
4949[%0: noescape **]
5050}
51+ sil @inout_class_argument2 : $@convention(thin) (@inout XandIntClass) -> () {
52+ [%0: noescape **]
53+ }
54+ sil @inout_class_argument3 : $@convention(thin) (@inout XandIntClass) -> @error Error {
55+ [%0: noescape **]
56+ }
5157sil @container_argument : $@convention(thin) (@guaranteed Container) -> ()
5258sil @take_closure_as_addr : $@convention(thin) (@in @callee_guaranteed () -> ()) -> ()
5359sil @take_closure_as_addr_noescape : $@convention(thin) (@in @callee_guaranteed () -> ()) -> () {
@@ -813,6 +819,9 @@ bb0(%0 : @owned $X):
813819
814820// CHECK-LABEL: Address escape information for test_unchecked_addr_cast:
815821// CHECK: value: %1 = alloc_stack $X
822+ // CHECK: ==> %10 = apply %9(%4) : $@convention(thin) (@inout XandIntClass) -> ()
823+ // CHECK: ==> try_apply %11(%4) : $@convention(thin) (@inout XandIntClass) -> @error any Error, normal bb1, error bb2
824+ // CHECK: - %15 = apply %14() : $@convention(thin) () -> ()
816825// CHECK-NEXT: End function test_unchecked_addr_cast
817826sil [ossa] @test_unchecked_addr_cast : $@convention(thin) (@owned X) -> @owned XandIntClass {
818827bb0(%0 : @owned $X):
@@ -824,25 +833,19 @@ bb0(%0 : @owned $X):
824833 %6 = load_borrow %4 : $*XandIntClass
825834 end_borrow %6 : $XandIntClass
826835 %8 = load [take] %4 : $*XandIntClass
836+ %9 = function_ref @inout_class_argument2 : $@convention(thin) (@inout XandIntClass) -> ()
837+ %10 = apply %9(%4) : $@convention(thin) (@inout XandIntClass) -> ()
838+ %11 = function_ref @inout_class_argument3 : $@convention(thin) (@inout XandIntClass) -> @error Error
839+ try_apply %11(%4) : $@convention(thin) (@inout XandIntClass) -> @error Error, normal bb1, error bb2
840+
841+ bb1(%13 : $()):
842+ %14 = function_ref @no_arguments : $@convention(thin) () -> ()
843+ %15 = apply %14() : $@convention(thin) () -> ()
827844 dealloc_stack %1 : $*X
828845 return %8 : $XandIntClass
829- }
830846
831- // CHECK-LABEL: Address escape information for test_unchecked_addr_cast_escaping:
832- // CHECK: value: %1 = alloc_stack $X
833- // CHECK-NEXT: ==> %6 = apply %5(%4) : $@convention(thin) (@inout X) -> ()
834- // CHECK-NEXT: End function test_unchecked_addr_cast_escaping
835- sil [ossa] @test_unchecked_addr_cast_escaping : $@convention(thin) (@owned XandIntClass) -> () {
836- bb0(%0 : @owned $XandIntClass):
837- %1 = alloc_stack $XandIntClass
838- store %0 to [init] %1 : $*XandIntClass
839- fix_lifetime %1 : $*XandIntClass
840- %4 = unchecked_addr_cast %1 : $*XandIntClass to $*X
841- %5 = function_ref @inout_class_argument : $@convention(thin) (@inout X) -> ()
842- %6 = apply %5(%4) : $@convention(thin) (@inout X) -> ()
843- dealloc_stack %1 : $*XandIntClass
844- %8 = tuple ()
845- return %8 : $()
847+ bb2(%17 : $Error):
848+ unreachable
846849}
847850
848851// CHECK-LABEL: Address escape information for test_store_borrow:
0 commit comments