Skip to content

Commit e8b5f1e

Browse files
Suyash SrijanSuyash Srijan
authored andcommitted
[test] add double optional test
1 parent 4e56b54 commit e8b5f1e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/SILGen/enum.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,14 @@ func sr7799(bar: SR7799?) {
253253
default: print("default")
254254
}
255255
}
256+
257+
// CHECK-LABEL: sil hidden [ossa] @$s4enum8sr7799_13baryAA6SR7799OSgSg_tF : $@convention(thin) (Optional<Optional<SR7799>>) -> () {
258+
// CHECK: bb0(%0 : $Optional<Optional<SR7799>>):
259+
// CHECK-NEXT: debug_value %0 : $Optional<Optional<SR7799>>, let, name "bar", argno 1
260+
// CHECK-NEXT: switch_enum %0 : $Optional<Optional<SR7799>>, case #Optional.none!enumelt: bb1, default bb2
261+
func sr7799_1(bar: SR7799??) {
262+
switch bar {
263+
case .none: print("none")
264+
default: print("default")
265+
}
266+
}

0 commit comments

Comments
 (0)