File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ case some(T)
20
20
}
21
21
22
22
class C {}
23
+ class D {
24
+ var object: C
25
+ }
23
26
24
27
// CHECK-LABEL: @testSelfLoop
25
28
// CHECK: SSA lifetime analysis: [[V:%.*]] = copy_value %0 : $C
@@ -109,3 +112,23 @@ bb4:
109
112
%99 = tuple()
110
113
return %99 : $()
111
114
}
115
+
116
+ // CHECK-LABEL: @testGuaranteedForwarding
117
+ // CHECK: SSA lifetime analysis: [[C:%.*]] = unchecked_ref_cast %{{.*}} : $D to $C
118
+ // CHECK: bb0: LiveWithin
119
+ // CHECK: regular user: %{{.*}} = load [copy]
120
+ // CHECK: last user: %{{.*}} = load [copy]
121
+ sil [ossa] @testGuaranteedForwarding : $@convention(thin) (@owned D) -> () {
122
+ bb0(%0 : @owned $D):
123
+ %borrow0 = begin_borrow %0 : $D
124
+ %c = unchecked_ref_cast %borrow0 : $D to $C
125
+ debug_value [trace] %c : $C
126
+ %d = unchecked_ref_cast %c : $C to $D
127
+ %f = ref_element_addr %d : $D, #D.object
128
+ %o = load [copy] %f : $*C
129
+ end_borrow %borrow0 : $D
130
+ destroy_value %o : $C
131
+ destroy_value %0 : $D
132
+ %99 = tuple()
133
+ return %99 : $()
134
+ }
You can’t perform that action at this time.
0 commit comments