Skip to content

Commit

Permalink
Bless mir-opt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed May 9, 2020
1 parent 1a19c1d commit a030c92
Show file tree
Hide file tree
Showing 46 changed files with 820 additions and 974 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,14 @@ fn main() -> () {
StorageLive(_5); // scope 3 at $DIR/basic_assignment.rs:19:9: 19:15
StorageLive(_6); // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
_6 = move _4; // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
replace(_5 <- move _6) -> [return: bb2, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:23:5: 23:11
replace(_5 <- move _6) -> [return: bb1, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:23:5: 23:11
}

bb1 (cleanup): {
resume; // scope 0 at $DIR/basic_assignment.rs:10:1: 24:2
bb1: {
drop(_6) -> [return: bb2, unwind: bb6]; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
}

bb2: {
drop(_6) -> [return: bb6, unwind: bb4]; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
}

bb3 (cleanup): {
drop(_4) -> bb1; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
}

bb4 (cleanup): {
drop(_5) -> bb3; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
}

bb5 (cleanup): {
drop(_6) -> bb4; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
}

bb6: {
StorageDead(_6); // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
_0 = const (); // scope 0 at $DIR/basic_assignment.rs:10:11: 24:2
// ty::Const
Expand All @@ -79,18 +63,34 @@ fn main() -> () {
// mir::Constant
// + span: $DIR/basic_assignment.rs:10:11: 24:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
drop(_5) -> [return: bb7, unwind: bb3]; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
drop(_5) -> [return: bb3, unwind: bb7]; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
}

bb7: {
bb3: {
StorageDead(_5); // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
drop(_4) -> [return: bb8, unwind: bb1]; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
drop(_4) -> [return: bb4, unwind: bb8]; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
}

bb8: {
bb4: {
StorageDead(_4); // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
StorageDead(_2); // scope 1 at $DIR/basic_assignment.rs:24:1: 24:2
StorageDead(_1); // scope 0 at $DIR/basic_assignment.rs:24:1: 24:2
return; // scope 0 at $DIR/basic_assignment.rs:24:2: 24:2
}

bb5 (cleanup): {
drop(_6) -> bb6; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
}

bb6 (cleanup): {
drop(_5) -> bb7; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
}

bb7 (cleanup): {
drop(_4) -> bb8; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
}

bb8 (cleanup): {
resume; // scope 0 at $DIR/basic_assignment.rs:10:1: 24:2
}
}
40 changes: 20 additions & 20 deletions src/test/mir-opt/box_expr/rustc.main.ElaborateDrops.before.mir
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn main() -> () {
StorageLive(_1); // scope 0 at $DIR/box_expr.rs:7:9: 7:10
StorageLive(_2); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
_2 = Box(S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
(*_2) = const S::new() -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
(*_2) = const S::new() -> [return: bb1, unwind: bb7]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
// ty::Const
// + ty: fn() -> S {S::new}
// + val: Value(Scalar(<ZST>))
Expand All @@ -23,25 +23,17 @@ fn main() -> () {
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
}

bb1 (cleanup): {
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
}

bb2: {
bb1: {
_1 = move _2; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
drop(_2) -> bb4; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}

bb3 (cleanup): {
drop(_2) -> bb1; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
drop(_2) -> bb2; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}

bb4: {
bb2: {
StorageDead(_2); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
StorageLive(_3); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_3 = const std::mem::drop::<std::boxed::Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
_3 = const std::mem::drop::<std::boxed::Box<S>>(move _4) -> [return: bb3, unwind: bb5]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
// ty::Const
// + ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}
// + val: Value(Scalar(<ZST>))
Expand All @@ -50,7 +42,7 @@ fn main() -> () {
// + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }
}

bb5: {
bb3: {
StorageDead(_4); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
StorageDead(_3); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
_0 = const (); // scope 0 at $DIR/box_expr.rs:6:11: 9:2
Expand All @@ -60,19 +52,27 @@ fn main() -> () {
// mir::Constant
// + span: $DIR/box_expr.rs:6:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
drop(_1) -> bb4; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}

bb4: {
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
}

bb5 (cleanup): {
drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
}

bb6 (cleanup): {
drop(_1) -> bb1; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}

bb7 (cleanup): {
drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
drop(_2) -> bb8; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}

bb8: {
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
bb8 (cleanup): {
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), [], Some(promoted[0])) }
+ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
_1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
_0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
_0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
// ty::Const
// + ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}
// + val: Value(Scalar(<ZST>))
Expand All @@ -42,15 +42,15 @@
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) }
}

bb1 (cleanup): {
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
}

bb2: {
bb1: {
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
}

bb2 (cleanup): {
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
}
- }
-
- alloc0 (static: Y, size: 4, align: 4) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(DefId(0:7 ~ const_promotion_extern_static[317d]::FOO[0]), [], Some(promoted[0])) }
+ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
_1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
_0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
_0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
// ty::Const
// + ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}
// + val: Value(Scalar(<ZST>))
Expand All @@ -44,15 +44,15 @@
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) }
}

bb1 (cleanup): {
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
}

bb2: {
bb1: {
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
}

bb2 (cleanup): {
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
}
}
-
- alloc2 (extern static: X)
Expand Down
12 changes: 6 additions & 6 deletions src/test/mir-opt/const_prop/boxes/rustc.main.ConstProp.diff
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,10 @@
// + span: $DIR/boxes.rs:12:25: 12:26
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageDead(_2); // scope 0 at $DIR/boxes.rs:12:25: 12:26
drop(_3) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
drop(_3) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
}

bb1 (cleanup): {
resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2
}

bb2: {
bb1: {
StorageDead(_3); // scope 0 at $DIR/boxes.rs:12:26: 12:27
_0 = const (); // scope 0 at $DIR/boxes.rs:11:11: 13:2
// ty::Const
Expand All @@ -54,5 +50,9 @@
StorageDead(_1); // scope 0 at $DIR/boxes.rs:13:1: 13:2
return; // scope 0 at $DIR/boxes.rs:13:2: 13:2
}

bb2 (cleanup): {
resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -21,60 +21,56 @@ fn main::{{closure}}#0(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15:

bb0: {
_9 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
switchInt(move _9) -> [0u32: bb7, 3u32: bb11, otherwise: bb12]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
switchInt(move _9) -> [0u32: bb7, 3u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}

bb1 (cleanup): {
resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
bb1: {
StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
}

bb2 (cleanup): {
bb2: {
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
goto -> bb8; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
}

bb3: {
StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}

bb4: {
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
bb4 (cleanup): {
resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}

bb5: {
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
bb5 (cleanup): {
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
goto -> bb4; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
}

bb6: {
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}

bb7: {
goto -> bb10; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}

bb8 (cleanup): {
goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
bb8: {
goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
}

bb9: {
goto -> bb5; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
}

bb10: {
goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}

bb11: {
bb10: {
StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}

bb12: {
bb11: {
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
}
}
Loading

0 comments on commit a030c92

Please sign in to comment.