Skip to content

Commit

Permalink
Fix mir-opt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed Feb 29, 2020
1 parent 1f5fb7b commit 9a926f9
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 164 deletions.
20 changes: 8 additions & 12 deletions src/test/mir-opt/const-promotion-extern-static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ fn main() {}
// _3 = [move _4];
// _2 = &_3;
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> bb1;
// }
// ...
// bb2: {
// bb1: {
// StorageDead(_5);
// StorageDead(_3);
// return;
Expand All @@ -36,10 +35,9 @@ fn main() {}
// _3 = [move _4];
// _2 = &_3;
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> bb1;
// }
// ...
// bb2: {
// bb1: {
// StorageDead(_5);
// StorageDead(_3);
// return;
Expand All @@ -51,10 +49,9 @@ fn main() {}
// _6 = const BAR::promoted[0];
// _2 = &(*_6);
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> bb1;
// }
// ...
// bb2: {
// bb1: {
// return;
// }
// END rustc.BAR.PromoteTemps.after.mir
Expand All @@ -64,10 +61,9 @@ fn main() {}
// _6 = const FOO::promoted[0];
// _2 = &(*_6);
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> bb1;
// }
// ...
// bb2: {
// bb1: {
// return;
// }
// END rustc.FOO.PromoteTemps.after.mir
26 changes: 13 additions & 13 deletions src/test/mir-opt/generator-storage-dead-unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,61 +53,61 @@ fn main() {
// }
// bb1: {
// ...
// StorageLive(_7);
// _7 = move _2;
// _6 = const take::<Foo>(move _7) -> [return: bb2, unwind: bb9];
// StorageLive(_8);
// _8 = move _3;
// _7 = const take::<Foo>(move _8) -> [return: bb2, unwind: bb9];
// }
// bb2: {
// StorageDead(_8);
// StorageDead(_7);
// StorageLive(_9);
// _9 = move _3;
// _8 = const take::<Bar>(move _9) -> [return: bb3, unwind: bb8];
// StorageLive(_10);
// _10 = move _4;
// _9 = const take::<Bar>(move _10) -> [return: bb3, unwind: bb8];
// }
// bb3: {
// StorageDead(_10);
// StorageDead(_9);
// ...
// StorageDead(_4);
// StorageDead(_3);
// StorageDead(_2);
// drop(_1) -> [return: bb4, unwind: bb11];
// }
// bb4: {
// return;
// }
// bb5: {
// ...
// StorageDead(_3);
// drop(_2) -> [return: bb6, unwind: bb12];
// StorageDead(_4);
// drop(_3) -> [return: bb6, unwind: bb12];
// }
// bb6: {
// StorageDead(_2);
// StorageDead(_3);
// drop(_1) -> [return: bb7, unwind: bb11];
// }
// bb7: {
// generator_drop;
// }
// bb8 (cleanup): {
// StorageDead(_10);
// StorageDead(_9);
// StorageDead(_8);
// goto -> bb10;
// }
// bb9 (cleanup): {
// StorageDead(_8);
// StorageDead(_7);
// StorageDead(_6);
// goto -> bb10;
// }
// bb10 (cleanup): {
// StorageDead(_4);
// StorageDead(_3);
// StorageDead(_2);
// drop(_1) -> bb11;
// }
// bb11 (cleanup): {
// resume;
// }
// bb12 (cleanup): {
// StorageDead(_2);
// StorageDead(_3);
// drop(_1) -> bb11;
// }

Expand Down
26 changes: 13 additions & 13 deletions src/test/mir-opt/inline/inline-into-box-place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ fn main() {
// StorageLive(_1);
// StorageLive(_2);
// _2 = Box(std::vec::Vec<u32>);
// (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4];
// (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb1, unwind: bb4];
// }
// bb1 (cleanup): {
// resume;
// }
// bb2: {
// bb1: {
// _1 = move _2;
// StorageDead(_2);
// _0 = ();
// drop(_1) -> [return: bb3, unwind: bb1];
// drop(_1) -> [return: bb2, unwind: bb3];
// }
// bb3: {
// bb2: {
// StorageDead(_1);
// return;
// }
// bb3 (cleanup): {
// resume;
// }
// bb4 (cleanup): {
// _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1;
// _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb3;
// }
// END rustc.main.Inline.before.mir
// START rustc.main.Inline.after.mir
Expand All @@ -60,13 +60,13 @@ fn main() {
// _1 = move _2;
// StorageDead(_2);
// _0 = ();
// drop(_1) -> [return: bb2, unwind: bb1];
// drop(_1) -> [return: bb1, unwind: bb2];
// }
// bb1 (cleanup): {
// resume;
// }
// bb2: {
// bb1: {
// StorageDead(_1);
// return;
// }
// bb2 (cleanup): {
// resume;
// }
// END rustc.main.Inline.after.mir
28 changes: 14 additions & 14 deletions src/test/mir-opt/issue-62289.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,36 @@ fn main() {
// bb1: {
// StorageDead(_4);
// _5 = discriminant(_3);
// switchInt(move _5) -> [0isize: bb6, 1isize: bb3, otherwise: bb2];
// switchInt(move _5) -> [0isize: bb2, 1isize: bb4, otherwise: bb3];
// }
// bb2: {
// unreachable;
// StorageLive(_10);
// _10 = ((_3 as Ok).0: u32);
// (*_2) = _10;
// StorageDead(_10);
// _1 = move _2;
// drop(_2) -> [return: bb7, unwind: bb12];
// }
// bb3: {
// unreachable;
// }
// bb4: {
// StorageLive(_6);
// _6 = ((_3 as Err).0: std::option::NoneError);
// StorageLive(_8);
// StorageLive(_9);
// _9 = _6;
// _8 = const <std::option::NoneError as std::convert::From<std::option::NoneError>>::from(move _9) -> [return: bb4, unwind: bb13];
// _8 = const <std::option::NoneError as std::convert::From<std::option::NoneError>>::from(move _9) -> [return: bb5, unwind: bb13];
// }
// bb4: {
// bb5: {
// StorageDead(_9);
// _0 = const <std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error(move _8) -> [return: bb5, unwind: bb13];
// _0 = const <std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error(move _8) -> [return: bb6, unwind: bb13];
// }
// bb5: {
// bb6: {
// StorageDead(_8);
// StorageDead(_6);
// drop(_2) -> [return: bb9, unwind: bb11];
// }
// bb6: {
// StorageLive(_10);
// _10 = ((_3 as Ok).0: u32);
// (*_2) = _10;
// StorageDead(_10);
// _1 = move _2;
// drop(_2) -> [return: bb7, unwind: bb12];
// }
// bb7: {
// StorageDead(_2);
// _0 = std::option::Option::<std::boxed::Box<u32>>::Some(move _1,);
Expand Down
Loading

0 comments on commit 9a926f9

Please sign in to comment.