Skip to content

Commit 301f941

Browse files
committed
Bless mir-opt.
1 parent 71ba925 commit 301f941

File tree

2 files changed

+23
-27
lines changed

2 files changed

+23
-27
lines changed

tests/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ fn main() -> () {
1717
StorageLive(_2);
1818
_2 = Test1::C;
1919
_3 = discriminant(_2);
20-
switchInt(move _3) -> [2: bb1, otherwise: bb2];
21-
}
22-
23-
bb1: {
2420
StorageLive(_5);
2521
_5 = const "C";
2622
_1 = &(*_5);
@@ -31,27 +27,27 @@ fn main() -> () {
3127
StorageLive(_7);
3228
_7 = Test2::D;
3329
_8 = discriminant(_7);
34-
switchInt(move _8) -> [4: bb4, 5: bb3, otherwise: bb2];
35-
}
36-
37-
bb2: {
38-
unreachable;
30+
switchInt(move _8) -> [4: bb3, 5: bb1, otherwise: bb2];
3931
}
4032

41-
bb3: {
33+
bb1: {
4234
StorageLive(_9);
4335
_9 = const "E";
4436
_6 = &(*_9);
4537
StorageDead(_9);
46-
goto -> bb5;
38+
goto -> bb4;
4739
}
4840

49-
bb4: {
41+
bb2: {
42+
unreachable;
43+
}
44+
45+
bb3: {
5046
_6 = const "D";
51-
goto -> bb5;
47+
goto -> bb4;
5248
}
5349

54-
bb5: {
50+
bb4: {
5551
StorageDead(_7);
5652
StorageDead(_6);
5753
_0 = const ();

tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,53 +18,53 @@
1818
StorageLive(_2);
1919
_2 = Test1::C;
2020
_3 = discriminant(_2);
21-
- switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb1, otherwise: bb2];
22-
+ switchInt(move _3) -> [2: bb1, otherwise: bb2];
21+
- switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb1];
22+
+ switchInt(move _3) -> bb1;
2323
}
2424

2525
bb1: {
2626
StorageLive(_5);
2727
_5 = const "C";
2828
_1 = &(*_5);
2929
StorageDead(_5);
30-
goto -> bb5;
30+
goto -> bb4;
3131
}
3232

3333
bb2: {
34-
unreachable;
35-
}
36-
37-
bb3: {
3834
_1 = const "A(Empty)";
39-
goto -> bb5;
35+
goto -> bb4;
4036
}
4137

42-
bb4: {
38+
bb3: {
4339
StorageLive(_4);
4440
_4 = const "B(Empty)";
4541
_1 = &(*_4);
4642
StorageDead(_4);
47-
goto -> bb5;
43+
goto -> bb4;
4844
}
4945

50-
bb5: {
46+
bb4: {
5147
StorageDead(_2);
5248
StorageDead(_1);
5349
StorageLive(_6);
5450
StorageLive(_7);
5551
_7 = Test2::D;
5652
_8 = discriminant(_7);
57-
switchInt(move _8) -> [4: bb7, 5: bb6, otherwise: bb2];
53+
switchInt(move _8) -> [4: bb7, 5: bb5, otherwise: bb6];
5854
}
5955

60-
bb6: {
56+
bb5: {
6157
StorageLive(_9);
6258
_9 = const "E";
6359
_6 = &(*_9);
6460
StorageDead(_9);
6561
goto -> bb8;
6662
}
6763

64+
bb6: {
65+
unreachable;
66+
}
67+
6868
bb7: {
6969
_6 = const "D";
7070
goto -> bb8;

0 commit comments

Comments
 (0)