File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -250,3 +250,32 @@ bb22:
250
250
inject_enum_addr %3 : $*Optional<CustomStringConvertible>, #Optional.none!enumelt
251
251
br bb2
252
252
}
253
+
254
+ sil @no_init : $@convention(thin) () -> (@out ())
255
+
256
+ // CHECK-LABEL: sil @test_empty_tuple_uninintialized : $@convention(thin) () -> () {
257
+ // CHECK: init_enum_data_addr
258
+ // CHECK: inject_enum_addr
259
+ // CHECK-LABEL: } // end sil function 'test_empty_tuple_uninintialized'
260
+ sil @test_empty_tuple_uninintialized : $@convention(thin) () -> () {
261
+ bb0:
262
+ %0 = alloc_stack $Optional<()>
263
+ %1 = init_enum_data_addr %0 : $*Optional<()>, #Optional.some!enumelt
264
+ %f = function_ref @no_init : $@convention(thin) () -> (@out ())
265
+ apply %f(%1) : $@convention(thin) () -> (@out ())
266
+ inject_enum_addr %0 : $*Optional<()>, #Optional.some!enumelt
267
+ %2 = load %0 : $*Optional<()>
268
+ switch_enum %2 : $Optional<()>, case #Optional.some!enumelt: bb1, case #Optional.none!enumelt: bb2
269
+
270
+ bb1(%4 : $()):
271
+ br bb3
272
+
273
+ bb2:
274
+ br bb3
275
+
276
+ bb3:
277
+ dealloc_stack %0 : $*Optional<()>
278
+ %8 = tuple ()
279
+ return %8 : $()
280
+ }
281
+
You can’t perform that action at this time.
0 commit comments