Skip to content

Commit eb4d28b

Browse files
Bless mir-opt tests
1 parent ca8678b commit eb4d28b

File tree

3 files changed

+44
-16
lines changed

3 files changed

+44
-16
lines changed

src/test/mir-opt/no-drop-for-inactive-variant/rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir

+10-12
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,19 @@ fn unwrap(_1: std::option::Option<T>) -> T {
88
let mut _4: !; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
99
let mut _5: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
1010
let mut _6: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
11+
let mut _7: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
1112
scope 1 {
1213
debug x => _3; // in scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
1314
}
1415

1516
bb0: {
1617
_2 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
17-
switchInt(move _2) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
18+
switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
1819
}
1920

20-
bb1 (cleanup): {
21-
resume; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:1: 12:2
22-
}
23-
24-
bb2: {
21+
bb1: {
2522
StorageLive(_4); // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
26-
const std::rt::begin_panic::<&str>(const "explicit panic") -> bb5; // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
23+
const std::rt::begin_panic::<&str>(const "explicit panic") -> bb4; // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
2724
// ty::Const
2825
// + ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}
2926
// + val: Value(Scalar(<ZST>))
@@ -38,20 +35,21 @@ fn unwrap(_1: std::option::Option<T>) -> T {
3835
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) }
3936
}
4037

41-
bb3: {
38+
bb2: {
4239
unreachable; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:8:11: 8:14
4340
}
4441

45-
bb4: {
42+
bb3: {
4643
StorageLive(_3); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
4744
_3 = move ((_1 as Some).0: T); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
4845
_0 = move _3; // scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21
4946
StorageDead(_3); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:21: 9:22
50-
_5 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
47+
_6 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
5148
return; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2
5249
}
5350

54-
bb5 (cleanup): {
55-
drop(_1) -> bb1; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
51+
bb4 (cleanup): {
52+
_5 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
53+
resume; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:1: 12:2
5654
}
5755
}

src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads/32bit/rustc.map.SimplifyLocals.diff

+17-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,28 @@
77
let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
88
let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
99
- 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
10+
- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
1111
- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
12+
- let mut _7: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
1213
scope 1 {
1314
debug x => _3; // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
1415
}
1516

1617
bb0: {
18+
- _5 = const false; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
19+
- // ty::Const
20+
- // + ty: bool
21+
- // + val: Value(Scalar(0x00))
22+
- // mir::Constant
23+
- // + span: $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
24+
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
25+
- _5 = const true; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
26+
- // ty::Const
27+
- // + ty: bool
28+
- // + val: Value(Scalar(0x01))
29+
- // mir::Constant
30+
- // + span: $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
31+
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
1732
_2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
1833
switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
1934
}
@@ -35,7 +50,7 @@
3550
}
3651

3752
bb3: {
38-
- _5 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
53+
- _6 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
3954
return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
4055
}
4156
}

src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads/64bit/rustc.map.SimplifyLocals.diff

+17-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,28 @@
77
let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
88
let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
99
- 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
10+
- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
1111
- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
12+
- let mut _7: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
1213
scope 1 {
1314
debug x => _3; // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
1415
}
1516

1617
bb0: {
18+
- _5 = const false; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
19+
- // ty::Const
20+
- // + ty: bool
21+
- // + val: Value(Scalar(0x00))
22+
- // mir::Constant
23+
- // + span: $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
24+
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
25+
- _5 = const true; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
26+
- // ty::Const
27+
- // + ty: bool
28+
- // + val: Value(Scalar(0x01))
29+
- // mir::Constant
30+
- // + span: $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
31+
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
1732
_2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
1833
switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
1934
}
@@ -35,7 +50,7 @@
3550
}
3651

3752
bb3: {
38-
- _5 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
53+
- _6 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
3954
return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
4055
}
4156
}

0 commit comments

Comments
 (0)