File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1264,6 +1264,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
1264
1264
isa<AllocStackInst>(op) ||
1265
1265
isa<ProjectBoxInst>(op) ||
1266
1266
isa<RefElementAddrInst>(op) ||
1267
+ isa<PointerToAddressInst>(op) ||
1267
1268
isa<SILFunctionArgument>(op) ||
1268
1269
isa<BeginAccessInst>(op) ||
1269
1270
isa<MarkUninitializedInst>(op),
Original file line number Diff line number Diff line change @@ -56,3 +56,19 @@ public func modifyAndReadS() {
56
56
s. i = 42
57
57
takeS ( s)
58
58
}
59
+
60
+ var global = S ( i: 0 , o: nil )
61
+
62
+ func readGlobal( ) -> AnyObject ? {
63
+ return global. o
64
+ }
65
+
66
+ // CHECK-LABEL: sil hidden @_T017access_marker_gen10readGlobals9AnyObject_pSgyF
67
+ // CHECK: [[ADDRESSOR:%.*]] = function_ref @_T017access_marker_gen6globalAA1SVfau :
68
+ // CHECK-NEXT: [[T0:%.*]] = apply [[ADDRESSOR]]()
69
+ // CHECK-NEXT: [[T1:%.*]] = pointer_to_address [[T0]] : $Builtin.RawPointer to [strict] $*S
70
+ // CHECK-NEXT: [[T2:%.*]] = begin_access [read] [dynamic] [[T1]]
71
+ // CHECK-NEXT: [[T3:%.*]] = struct_element_addr [[T2]] : $*S, #S.o
72
+ // CHECK-NEXT: [[T4:%.*]] = load [copy] [[T3]]
73
+ // CHECK-NEXT: end_access [[T2]]
74
+ // CHECK-NEXT: return [[T4]]
You can’t perform that action at this time.
0 commit comments