File tree Expand file tree Collapse file tree 1 file changed +33
-2
lines changed
Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -805,13 +805,44 @@ bb0(%0 : $*C, %1 : $*C):
805805 return %2 : $C
806806}
807807
808+ sil_global hidden [let] @globalC : $C
809+ sil_global hidden @globalCVar : $C
810+
811+ // CHECK-LABEL: @testGlobalLet
812+ // CHECK: PAIR #1.
813+ // CHECK-NEXT: %3 = apply %2() : $@convention(thin) () -> ()
814+ // CHECK-NEXT: %0 = global_addr @globalC : $*C
815+ // CHECK-NEXT: r=1,w=0
816+ sil hidden @testGlobalLet : $@convention(thin) () -> () {
817+ bb0:
818+ %0 = global_addr @globalC : $*C
819+ %1 = load %0 : $*C
820+ %2 = function_ref @nouser_func : $@convention(thin) () -> () // user: %3
821+ %3 = apply %2() : $@convention(thin) () -> ()
822+ %8 = tuple ()
823+ return %8 : $()
824+ }
825+
826+ // CHECK-LABEL: @testGlobalVar
827+ // CHECK: PAIR #1.
828+ // CHECK-NEXT: %3 = apply %2() : $@convention(thin) () -> ()
829+ // CHECK-NEXT: %0 = global_addr @globalCVar : $*C
830+ // CHECK-NEXT: r=1,w=1
831+ sil hidden @testGlobalVar : $@convention(thin) () -> () {
832+ bb0:
833+ %0 = global_addr @globalCVar : $*C
834+ %1 = load %0 : $*C
835+ %2 = function_ref @nouser_func : $@convention(thin) () -> () // user: %3
836+ %3 = apply %2() : $@convention(thin) () -> ()
837+ %8 = tuple ()
838+ return %8 : $()
839+ }
840+
808841// ===-----------------------------------------------------------------------===
809842// Test the effect of a [deinit] access on a global 'let'
810843//
811844// Test <rdar://60046018> Assert: (v->getType().isAddress()), getAccessedAddress
812845
813- sil_global hidden [let] @globalC : $C
814-
815846// CHECK-LABEL: @testDeinitInstVsNonAddressValue
816847// CHECK: PAIR #3.
817848// CHECK-NEXT: load %{{.*}} : $*C
You can’t perform that action at this time.
0 commit comments