Skip to content

Commit 2ae25d5

Browse files
committed
Recreate the test cases for matches_reduce_branches.rs.
1 parent 7770cab commit 2ae25d5

File tree

34 files changed

+1790
-482
lines changed

34 files changed

+1790
-482
lines changed

tests/mir-opt/matches_reduce_branches.match_i16_i8.MatchBranchSimplification.diff

-42
This file was deleted.

tests/mir-opt/matches_reduce_branches.match_i8_i16.MatchBranchSimplification.diff

-42
This file was deleted.

tests/mir-opt/matches_reduce_branches.match_i8_i16_failed.MatchBranchSimplification.diff

-37
This file was deleted.

tests/mir-opt/matches_reduce_branches.match_i8_i16_failed_2.MatchBranchSimplification.diff

-37
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
- // MIR for `match_sext_i8_i16` before MatchBranchSimplification
2+
+ // MIR for `match_sext_i8_i16` after MatchBranchSimplification
3+
4+
fn match_sext_i8_i16(_1: EnumAi8) -> i16 {
5+
debug i => _1;
6+
let mut _0: i16;
7+
let mut _2: i8;
8+
+ let mut _3: i8;
9+
10+
bb0: {
11+
_2 = discriminant(_1);
12+
- switchInt(move _2) -> [128: bb3, 255: bb4, 0: bb5, 1: bb6, 127: bb2, otherwise: bb1];
13+
- }
14+
-
15+
- bb1: {
16+
- unreachable;
17+
- }
18+
-
19+
- bb2: {
20+
- _0 = const 127_i16;
21+
- goto -> bb7;
22+
- }
23+
-
24+
- bb3: {
25+
- _0 = const -128_i16;
26+
- goto -> bb7;
27+
- }
28+
-
29+
- bb4: {
30+
- _0 = const -1_i16;
31+
- goto -> bb7;
32+
- }
33+
-
34+
- bb5: {
35+
- _0 = const 0_i16;
36+
- goto -> bb7;
37+
- }
38+
-
39+
- bb6: {
40+
- _0 = const 1_i16;
41+
- goto -> bb7;
42+
- }
43+
-
44+
- bb7: {
45+
+ StorageLive(_3);
46+
+ _3 = move _2;
47+
+ _0 = _3 as i16 (IntToInt);
48+
+ StorageDead(_3);
49+
return;
50+
}
51+
}
52+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
- // MIR for `match_sext_i8_i16_failed` before MatchBranchSimplification
2+
+ // MIR for `match_sext_i8_i16_failed` after MatchBranchSimplification
3+
4+
fn match_sext_i8_i16_failed(_1: EnumAi8) -> i16 {
5+
debug i => _1;
6+
let mut _0: i16;
7+
let mut _2: i8;
8+
9+
bb0: {
10+
_2 = discriminant(_1);
11+
switchInt(move _2) -> [128: bb3, 255: bb4, 0: bb5, 1: bb6, 127: bb2, otherwise: bb1];
12+
}
13+
14+
bb1: {
15+
unreachable;
16+
}
17+
18+
bb2: {
19+
_0 = const 127_i16;
20+
goto -> bb7;
21+
}
22+
23+
bb3: {
24+
_0 = const -128_i16;
25+
goto -> bb7;
26+
}
27+
28+
bb4: {
29+
_0 = const 255_i16;
30+
goto -> bb7;
31+
}
32+
33+
bb5: {
34+
_0 = const 0_i16;
35+
goto -> bb7;
36+
}
37+
38+
bb6: {
39+
_0 = const 1_i16;
40+
goto -> bb7;
41+
}
42+
43+
bb7: {
44+
return;
45+
}
46+
}
47+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
- // MIR for `match_sext_i8_u16` before MatchBranchSimplification
2+
+ // MIR for `match_sext_i8_u16` after MatchBranchSimplification
3+
4+
fn match_sext_i8_u16(_1: EnumAi8) -> u16 {
5+
debug i => _1;
6+
let mut _0: u16;
7+
let mut _2: i8;
8+
+ let mut _3: i8;
9+
10+
bb0: {
11+
_2 = discriminant(_1);
12+
- switchInt(move _2) -> [128: bb3, 255: bb4, 0: bb5, 1: bb6, 127: bb2, otherwise: bb1];
13+
- }
14+
-
15+
- bb1: {
16+
- unreachable;
17+
- }
18+
-
19+
- bb2: {
20+
- _0 = const 127_u16;
21+
- goto -> bb7;
22+
- }
23+
-
24+
- bb3: {
25+
- _0 = const 65408_u16;
26+
- goto -> bb7;
27+
- }
28+
-
29+
- bb4: {
30+
- _0 = const u16::MAX;
31+
- goto -> bb7;
32+
- }
33+
-
34+
- bb5: {
35+
- _0 = const 0_u16;
36+
- goto -> bb7;
37+
- }
38+
-
39+
- bb6: {
40+
- _0 = const 1_u16;
41+
- goto -> bb7;
42+
- }
43+
-
44+
- bb7: {
45+
+ StorageLive(_3);
46+
+ _3 = move _2;
47+
+ _0 = _3 as u16 (IntToInt);
48+
+ StorageDead(_3);
49+
return;
50+
}
51+
}
52+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
- // MIR for `match_sext_i8_u16_failed` before MatchBranchSimplification
2+
+ // MIR for `match_sext_i8_u16_failed` after MatchBranchSimplification
3+
4+
fn match_sext_i8_u16_failed(_1: EnumAi8) -> u16 {
5+
debug i => _1;
6+
let mut _0: u16;
7+
let mut _2: i8;
8+
9+
bb0: {
10+
_2 = discriminant(_1);
11+
switchInt(move _2) -> [128: bb3, 255: bb4, 0: bb5, 1: bb6, 127: bb2, otherwise: bb1];
12+
}
13+
14+
bb1: {
15+
unreachable;
16+
}
17+
18+
bb2: {
19+
_0 = const 127_u16;
20+
goto -> bb7;
21+
}
22+
23+
bb3: {
24+
_0 = const 65408_u16;
25+
goto -> bb7;
26+
}
27+
28+
bb4: {
29+
_0 = const 255_u16;
30+
goto -> bb7;
31+
}
32+
33+
bb5: {
34+
_0 = const 0_u16;
35+
goto -> bb7;
36+
}
37+
38+
bb6: {
39+
_0 = const 1_u16;
40+
goto -> bb7;
41+
}
42+
43+
bb7: {
44+
return;
45+
}
46+
}
47+

0 commit comments

Comments
 (0)