@@ -48,6 +48,12 @@ sil @non_escaping_class_argument : $@convention(thin) (@guaranteed X) -> () {
48
48
sil @inout_class_argument : $@convention(thin) (@inout X) -> () {
49
49
[%0: noescape **]
50
50
}
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
+ }
51
57
sil @container_argument : $@convention(thin) (@guaranteed Container) -> ()
52
58
sil @take_closure_as_addr : $@convention(thin) (@in @callee_guaranteed () -> ()) -> ()
53
59
sil @take_closure_as_addr_noescape : $@convention(thin) (@in @callee_guaranteed () -> ()) -> () {
@@ -813,6 +819,9 @@ bb0(%0 : @owned $X):
813
819
814
820
// CHECK-LABEL: Address escape information for test_unchecked_addr_cast:
815
821
// 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) () -> ()
816
825
// CHECK-NEXT: End function test_unchecked_addr_cast
817
826
sil [ossa] @test_unchecked_addr_cast : $@convention(thin) (@owned X) -> @owned XandIntClass {
818
827
bb0(%0 : @owned $X):
@@ -824,25 +833,19 @@ bb0(%0 : @owned $X):
824
833
%6 = load_borrow %4 : $*XandIntClass
825
834
end_borrow %6 : $XandIntClass
826
835
%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) () -> ()
827
844
dealloc_stack %1 : $*X
828
845
return %8 : $XandIntClass
829
- }
830
846
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
846
849
}
847
850
848
851
// CHECK-LABEL: Address escape information for test_store_borrow:
0 commit comments