@@ -26,6 +26,40 @@ public struct DidSetWillSetTests {
26
26
}
27
27
28
28
public var a : Int {
29
+ // This is the synthesized getter and setter for the willset/didset variable.
30
+
31
+ // CHECK-LABEL: sil [transparent] [serialized] [ossa] @$s9observers010DidSetWillC5TestsV1aSivg
32
+ // CHECK: bb0(%0 : $DidSetWillSetTests):
33
+ // CHECK-NEXT: debug_value %0
34
+ // CHECK-NEXT: %2 = struct_extract %0 : $DidSetWillSetTests, #DidSetWillSetTests.a
35
+ // CHECK-NEXT: return %2 : $Int{{.*}} // id: %3
36
+
37
+
38
+ // CHECK-LABEL: sil [ossa] @$s9observers010DidSetWillC5TestsV1aSivs
39
+ // CHECK: bb0(%0 : $Int, %1 : $*DidSetWillSetTests):
40
+ // CHECK-NEXT: debug_value %0
41
+ // CHECK-NEXT: debug_value_addr %1
42
+
43
+ // CHECK-NEXT: [[READ:%.*]] = begin_access [read] [unknown] %1
44
+ // CHECK-NEXT: [[AADDR:%.*]] = struct_element_addr [[READ]] : $*DidSetWillSetTests, #DidSetWillSetTests.a
45
+ // CHECK-NEXT: [[OLDVAL:%.*]] = load [trivial] [[AADDR]] : $*Int
46
+ // CHECK-NEXT: end_access [[READ]]
47
+ // CHECK-NEXT: debug_value [[OLDVAL]] : $Int, let, name "tmp"
48
+
49
+ // CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] %1
50
+ // CHECK-NEXT: // function_ref {{.*}}.DidSetWillSetTests.a.willset : Swift.Int
51
+ // CHECK-NEXT: [[WILLSETFN:%.*]] = function_ref @$s9observers010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}vw
52
+ // CHECK-NEXT: apply [[WILLSETFN]](%0, [[WRITE]]) : $@convention(method) (Int, @inout DidSetWillSetTests) -> ()
53
+ // CHECK-NEXT: end_access [[WRITE]]
54
+ // CHECK-NEXT: [[WRITE:%.*]] = begin_access [modify] [unknown] %1
55
+ // CHECK-NEXT: [[AADDR:%.*]] = struct_element_addr [[WRITE]] : $*DidSetWillSetTests, #DidSetWillSetTests.a
56
+ // CHECK-NEXT: assign %0 to [[AADDR]] : $*Int
57
+ // CHECK-NEXT: end_access [[WRITE]]
58
+ // CHECK-NEXT: [[WRITE:%.*]] = begin_access [modify] [unknown] %1
59
+ // CHECK-NEXT: // function_ref {{.*}}.DidSetWillSetTests.a.didset : Swift.Int
60
+ // CHECK-NEXT: [[DIDSETFN:%.*]] = function_ref @$s9observers010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}vW : $@convention(method) (Int, @inout DidSetWillSetTests) -> ()
61
+ // CHECK-NEXT: apply [[DIDSETFN]]([[OLDVAL]], [[WRITE]]) : $@convention(method) (Int, @inout DidSetWillSetTests) -> ()
62
+
29
63
// CHECK-LABEL: sil private [ossa] @$s9observers010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}vw
30
64
willSet( newA) {
31
65
// CHECK: bb0(%0 : $Int, %1 : $*DidSetWillSetTests):
@@ -92,40 +126,6 @@ public struct DidSetWillSetTests {
92
126
}
93
127
}
94
128
95
- // This is the synthesized getter and setter for the willset/didset variable.
96
-
97
- // CHECK-LABEL: sil [transparent] [serialized] [ossa] @$s9observers010DidSetWillC5TestsV1aSivg
98
- // CHECK: bb0(%0 : $DidSetWillSetTests):
99
- // CHECK-NEXT: debug_value %0
100
- // CHECK-NEXT: %2 = struct_extract %0 : $DidSetWillSetTests, #DidSetWillSetTests.a
101
- // CHECK-NEXT: return %2 : $Int{{.*}} // id: %3
102
-
103
-
104
- // CHECK-LABEL: sil [ossa] @$s9observers010DidSetWillC5TestsV1aSivs
105
- // CHECK: bb0(%0 : $Int, %1 : $*DidSetWillSetTests):
106
- // CHECK-NEXT: debug_value %0
107
- // CHECK-NEXT: debug_value_addr %1
108
-
109
- // CHECK-NEXT: [[READ:%.*]] = begin_access [read] [unknown] %1
110
- // CHECK-NEXT: [[AADDR:%.*]] = struct_element_addr [[READ]] : $*DidSetWillSetTests, #DidSetWillSetTests.a
111
- // CHECK-NEXT: [[OLDVAL:%.*]] = load [trivial] [[AADDR]] : $*Int
112
- // CHECK-NEXT: end_access [[READ]]
113
- // CHECK-NEXT: debug_value [[OLDVAL]] : $Int, let, name "tmp"
114
-
115
- // CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] %1
116
- // CHECK-NEXT: // function_ref {{.*}}.DidSetWillSetTests.a.willset : Swift.Int
117
- // CHECK-NEXT: [[WILLSETFN:%.*]] = function_ref @$s9observers010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}vw
118
- // CHECK-NEXT: apply [[WILLSETFN]](%0, [[WRITE]]) : $@convention(method) (Int, @inout DidSetWillSetTests) -> ()
119
- // CHECK-NEXT: end_access [[WRITE]]
120
- // CHECK-NEXT: [[WRITE:%.*]] = begin_access [modify] [unknown] %1
121
- // CHECK-NEXT: [[AADDR:%.*]] = struct_element_addr [[WRITE]] : $*DidSetWillSetTests, #DidSetWillSetTests.a
122
- // CHECK-NEXT: assign %0 to [[AADDR]] : $*Int
123
- // CHECK-NEXT: end_access [[WRITE]]
124
- // CHECK-NEXT: [[WRITE:%.*]] = begin_access [modify] [unknown] %1
125
- // CHECK-NEXT: // function_ref {{.*}}.DidSetWillSetTests.a.didset : Swift.Int
126
- // CHECK-NEXT: [[DIDSETFN:%.*]] = function_ref @$s9observers010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}vW : $@convention(method) (Int, @inout DidSetWillSetTests) -> ()
127
- // CHECK-NEXT: apply [[DIDSETFN]]([[OLDVAL]], [[WRITE]]) : $@convention(method) (Int, @inout DidSetWillSetTests) -> ()
128
-
129
129
// CHECK-LABEL: sil hidden [ossa] @$s9observers010DidSetWillC5TestsV8testReadSiyF
130
130
// CHECK: [[SELF:%.*]] = begin_access [read] [unknown] %0 : $*DidSetWillSetTests
131
131
// CHECK-NEXT: [[PROP:%.*]] = struct_element_addr [[SELF]] : $*DidSetWillSetTests
@@ -313,7 +313,7 @@ func propertyWithDidSetTakingOldValue() {
313
313
314
314
// CHECK-LABEL: sil private [ossa] @$s9observers32propertyWithDidSetTakingOldValueyyF1pL_Sivs
315
315
// CHECK: bb0([[ARG1:%.*]] : $Int, [[ARG2:%.*]] : @guaranteed ${ var Int }):
316
- // CHECK-NEXT: debug_value [[ARG1]] : $Int, let, name "newValue ", argno 1
316
+ // CHECK-NEXT: debug_value [[ARG1]] : $Int, let, name "value ", argno 1
317
317
// CHECK-NEXT: [[ARG2_PB:%.*]] = project_box [[ARG2]]
318
318
// CHECK-NEXT: debug_value_addr [[ARG2_PB]] : $*Int, var, name "p", argno 2
319
319
// CHECK-NEXT: [[READ:%.*]] = begin_access [read] [unknown] [[ARG2_PB]]
0 commit comments