Skip to content

Commit 2f49d55

Browse files
committed
Add EMIR_MIR_FOR_EACH_BIT_WIDTH to failing test
1 parent c06876c commit 2f49d55

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ fn main() {
99
map(None);
1010
}
1111

12+
// EMIT_MIR_FOR_EACH_BIT_WIDTH
1213
// EMIT_MIR rustc.map.SimplifyLocals.diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
- // MIR for `map` before SimplifyLocals
2+
+ // MIR for `map` after SimplifyLocals
3+
4+
fn map(_1: std::option::Option<std::boxed::Box<()>>) -> std::option::Option<std::boxed::Box<()>> {
5+
debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9
6+
let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46
7+
let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
8+
let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
9+
- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:25: 4:26
10+
- let mut _5: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
11+
- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
12+
scope 1 {
13+
debug x => _3; // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
14+
}
15+
16+
bb0: {
17+
_2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
18+
switchInt(move _2) -> [0isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
19+
}
20+
21+
bb1: {
22+
_0 = move _1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
23+
goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
24+
}
25+
26+
bb2: {
27+
_0 = const std::option::Option::<std::boxed::Box<()>>::None; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:17: 3:21
28+
// ty::Const
29+
// + ty: std::option::Option<std::boxed::Box<()>>
30+
// + val: Value(Scalar(0x00000000))
31+
// mir::Constant
32+
// + span: $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:17: 3:21
33+
// + literal: Const { ty: std::option::Option<std::boxed::Box<()>>, val: Value(Scalar(0x00000000)) }
34+
goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
35+
}
36+
37+
bb3: {
38+
- _5 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
39+
return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
40+
}
41+
}
42+

0 commit comments

Comments
 (0)