File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -5277,6 +5277,11 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
5277
5277
return true ;
5278
5278
}
5279
5279
5280
+ if (!B.hasValidInsertionPoint ()) {
5281
+ P.diagnose (P.Tok , diag::expected_sil_block_name);
5282
+ return true ;
5283
+ }
5284
+
5280
5285
SmallVector<Located<StringRef>, 4 > resultNames;
5281
5286
SourceLoc resultClauseBegin;
5282
5287
Original file line number Diff line number Diff line change @@ -56,3 +56,11 @@ sil @test_formal_substituted_type : $@convention(thin) <X> (@owned Array<@substi
56
56
entry(%0 : $Array<X>):
57
57
return undef : $()
58
58
}
59
+
60
+ sil @instructions_after_terminator : $@convention(thin) () -> () {
61
+ bb0:
62
+ unreachable
63
+ %0 = tuple () // expected-error {{expected basic block name or '}'}}
64
+ return %0 : $()
65
+ }
66
+
Original file line number Diff line number Diff line change @@ -2413,19 +2413,6 @@ bb0:
2413
2413
}
2414
2414
2415
2415
2416
- // CHECK-LABEL: sil @remove_dead_code_after_unreachable
2417
- // CHECK-NEXT: bb0
2418
- // CHECK-NEXT: unreachable
2419
- // CHECK-NEXT: } // end sil function 'remove_dead_code_after_unreachable'
2420
- sil @remove_dead_code_after_unreachable : $@convention(thin) () -> (Int32) {
2421
- bb0:
2422
- unreachable
2423
- %2 = integer_literal $Builtin.Int32, -2
2424
- %3 = struct $Int32 (%2 : $Builtin.Int32)
2425
- return %3 : $Int32
2426
- }
2427
-
2428
-
2429
2416
// CHECK-LABEL: sil @dont_remove_code_after_cond_fail
2430
2417
// CHECK: bb0([[Cond:%.*]] : $Builtin.Int1):
2431
2418
// CHECK-NEXT: [[Ref:%.*]] = integer_literal $Builtin.Int32, -2
You can’t perform that action at this time.
0 commit comments