@@ -803,7 +803,7 @@ struct S {
803
803
}
804
804
805
805
// CHECK-LABEL: sil [ossa] @testStruct :
806
- // CHECK: [[C]] = function_ref @$s17closureWithStruct4main1SVs5Int32VSbTf3npSSi3Si0_n : $@convention(thin) (Str) -> Builtin.Int32
806
+ // CHECK: [[C:%.* ]] = function_ref @$s17closureWithStruct4main1SVs5Int32VSbTf3npSSi3Si0_n : $@convention(thin) (Str) -> Builtin.Int32
807
807
// CHECK: thin_to_thick_function [[C]] : $@convention(thin) (Str) -> Builtin.Int32 to $@callee_guaranteed (Str) -> Builtin.Int32
808
808
// CHECK: } // end sil function 'testStruct'
809
809
sil [ossa] @testStruct : $@convention(thin) () -> () {
@@ -843,3 +843,35 @@ bb0(%0 : $Str, %1 : $S):
843
843
}
844
844
845
845
sil @swift_getAtKeyPath : $@convention(thin) <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0, @guaranteed KeyPath<τ_0_0, τ_0_1>) -> @out τ_0_1
846
+
847
+ struct NonTrivialStruct {
848
+ var x: AnyObject
849
+ }
850
+
851
+ sil_global [serialized] @gNonTrivialStruct : $NonTrivialStruct
852
+
853
+ // CHECK-LABEL: sil [ossa] @test_global_addr :
854
+ // CHECK: [[C:%.*]] = function_ref @$s19global_addr_closure17gNonTrivialStructTf3pg_n : $@convention(thin) () -> ()
855
+ // CHECK: thin_to_thick_function %2 : $@convention(thin) () -> () to $@callee_owned () -> ()
856
+ // CHECK: } // end sil function 'test_global_addr'
857
+ sil [ossa] @test_global_addr : $@convention(thin) () -> () {
858
+ %3 = global_addr @gNonTrivialStruct : $*NonTrivialStruct
859
+ %7 = function_ref @global_addr_closure : $@convention(thin) <T> (@in_guaranteed T) -> ()
860
+ %8 = partial_apply %7<NonTrivialStruct>(%3) : $@convention(thin) <T> (@in_guaranteed T) -> ()
861
+ destroy_value %8
862
+ %r = tuple()
863
+ return %r
864
+ }
865
+
866
+ // CHECK-LABEL: sil shared [ossa] @$s19global_addr_closure17gNonTrivialStructTf3pg_n :
867
+ // CHECK: bb0:
868
+ // CHECK-NEXT: %0 = global_addr @gNonTrivialStruct : $*NonTrivialStruct
869
+ // CHECK-NEXT: %1 = tuple ()
870
+ // CHECK-NEXT: return %1
871
+ // CHECK: } // end sil function '$s19global_addr_closure17gNonTrivialStructTf3pg_n'
872
+ sil [ossa] @global_addr_closure : $@convention(thin) <T> (@in_guaranteed T) -> () {
873
+ bb0(%0 : $*T):
874
+ %r = tuple()
875
+ return %r : $()
876
+ }
877
+
0 commit comments