File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -2163,3 +2163,31 @@ bb0(%0 : $@callee_guaranteed () -> ()):
2163
2163
%9999 = tuple()
2164
2164
return %9999 : $()
2165
2165
}
2166
+
2167
+ // Make sure we can move a release across a releasenone functions.
2168
+ //
2169
+ // CHECK-LABEL: sil @testReleaseNoneAttribute
2170
+ // CHECK-NOT: strong_retain
2171
+ // CHECK: [[RELEASENONE:%.*]] = function_ref @releaseNone
2172
+ // CHECK-NOT: strong_retain
2173
+ // CHECK: apply [[RELEASENONE]]
2174
+ // CHECK-NOT: strong_retain
2175
+ // CHECK: [[MAYRELEASE:%.*]] = function_ref @mayRelease
2176
+ // CHECK-NOT: strong_retain
2177
+ // CHECK: apply [[MAYRELEASE]]
2178
+ // CHECK-NOT: strong_retain
2179
+ // CHECK: return
2180
+ sil [releasenone] @releaseNone : $@convention(thin) () -> ()
2181
+ sil @mayRelease : $@convention(thin) () -> ()
2182
+
2183
+ sil @testReleaseNoneAttribute : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () {
2184
+ bb0(%0 : $Builtin.NativeObject):
2185
+ %1 = function_ref @releaseNone : $@convention(thin) () -> ()
2186
+ strong_retain %0 : $Builtin.NativeObject
2187
+ %2 = apply %1() : $@convention(thin) () -> ()
2188
+ %3 = function_ref @mayRelease : $@convention(thin) () -> ()
2189
+ %4 = apply %3() : $@convention(thin) () -> ()
2190
+ strong_release %0 : $Builtin.NativeObject
2191
+ %10 = tuple()
2192
+ return %10 : $()
2193
+ }
You can’t perform that action at this time.
0 commit comments