From 05d7a60ff89cd30f2aa7613ffb925a1fb143b7e4 Mon Sep 17 00:00:00 2001 From: Félix Fischer Date: Mon, 27 Apr 2020 19:05:44 -0400 Subject: Changed `simplify_match` output query because it had become outdated --- src/test/mir-opt/simplify_match.rs | 2 +- .../simplify_match/rustc.main.ConstProp.diff | 67 ++++++++++++++++++++++ ...ustc.main.SimplifyBranches-after-copy-prop.diff | 59 ------------------- 3 files changed, 68 insertions(+), 60 deletions(-) create mode 100644 src/test/mir-opt/simplify_match/rustc.main.ConstProp.diff delete mode 100644 src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff (limited to 'src') diff --git a/src/test/mir-opt/simplify_match.rs b/src/test/mir-opt/simplify_match.rs index 233f9ff4c40..b8e1ea6f981 100644 --- a/src/test/mir-opt/simplify_match.rs +++ b/src/test/mir-opt/simplify_match.rs @@ -1,7 +1,7 @@ #[inline(never)] fn noop() {} -// EMIT_MIR rustc.main.SimplifyBranches-after-copy-prop.diff +// EMIT_MIR rustc.main.ConstProp.diff fn main() { match { let x = false; x } { true => noop(), diff --git a/src/test/mir-opt/simplify_match/rustc.main.ConstProp.diff b/src/test/mir-opt/simplify_match/rustc.main.ConstProp.diff new file mode 100644 index 00000000000..8003112c46c --- /dev/null +++ b/src/test/mir-opt/simplify_match/rustc.main.ConstProp.diff @@ -0,0 +1,67 @@ +- // MIR for `main` before ConstProp ++ // MIR for `main` after ConstProp + + fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/simplify_match.rs:5:11: 5:11 + let mut _1: bool; // in scope 0 at $DIR/simplify_match.rs:6:11: 6:31 + let _2: bool; // in scope 0 at $DIR/simplify_match.rs:6:17: 6:18 + scope 1 { + debug x => _2; // in scope 1 at $DIR/simplify_match.rs:6:17: 6:18 + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/simplify_match.rs:6:11: 6:31 + StorageLive(_2); // scope 0 at $DIR/simplify_match.rs:6:17: 6:18 + _2 = const false; // scope 0 at $DIR/simplify_match.rs:6:21: 6:26 + // ty::Const + // + ty: bool + // + val: Value(Scalar(0x00)) + // mir::Constant + // + span: $DIR/simplify_match.rs:6:21: 6:26 + // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } +- _1 = _2; // scope 1 at $DIR/simplify_match.rs:6:28: 6:29 ++ _1 = const false; // scope 1 at $DIR/simplify_match.rs:6:28: 6:29 ++ // ty::Const ++ // + ty: bool ++ // + val: Value(Scalar(0x00)) ++ // mir::Constant ++ // + span: $DIR/simplify_match.rs:6:28: 6:29 ++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } + StorageDead(_2); // scope 0 at $DIR/simplify_match.rs:6:30: 6:31 +- switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:7:9: 7:13 ++ switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:7:9: 7:13 ++ // ty::Const ++ // + ty: bool ++ // + val: Value(Scalar(0x00)) ++ // mir::Constant ++ // + span: $DIR/simplify_match.rs:7:9: 7:13 ++ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } + } + + bb1: { + _0 = const (); // scope 0 at $DIR/simplify_match.rs:8:18: 8:20 + // ty::Const + // + ty: () + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify_match.rs:8:18: 8:20 + // + literal: Const { ty: (), val: Value(Scalar()) } + goto -> bb3; // scope 0 at $DIR/simplify_match.rs:6:5: 9:6 + } + + bb2: { + _0 = const noop() -> bb3; // scope 0 at $DIR/simplify_match.rs:7:17: 7:23 + // ty::Const + // + ty: fn() {noop} + // + val: Value(Scalar()) + // mir::Constant + // + span: $DIR/simplify_match.rs:7:17: 7:21 + // + literal: Const { ty: fn() {noop}, val: Value(Scalar()) } + } + + bb3: { + StorageDead(_1); // scope 0 at $DIR/simplify_match.rs:10:1: 10:2 + return; // scope 0 at $DIR/simplify_match.rs:10:2: 10:2 + } + } + diff --git a/src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff b/src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff deleted file mode 100644 index ae6dfae30b9..00000000000 --- a/src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff +++ /dev/null @@ -1,59 +0,0 @@ -- // MIR for `main` before SimplifyBranches-after-copy-prop -+ // MIR for `main` after SimplifyBranches-after-copy-prop - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/simplify_match.rs:5:11: 5:11 - let mut _1: bool; // in scope 0 at $DIR/simplify_match.rs:6:11: 6:31 - let _2: bool; // in scope 0 at $DIR/simplify_match.rs:6:17: 6:18 - scope 1 { - debug x => _2; // in scope 1 at $DIR/simplify_match.rs:6:17: 6:18 - } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/simplify_match.rs:6:11: 6:31 - StorageLive(_2); // scope 0 at $DIR/simplify_match.rs:6:17: 6:18 - _2 = const false; // scope 0 at $DIR/simplify_match.rs:6:21: 6:26 - // ty::Const - // + ty: bool - // + val: Value(Scalar(0x00)) - // mir::Constant - // + span: $DIR/simplify_match.rs:6:21: 6:26 - // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } - _1 = const false; // scope 1 at $DIR/simplify_match.rs:6:28: 6:29 - // ty::Const - // + ty: bool - // + val: Value(Scalar(0x00)) - // mir::Constant - // + span: $DIR/simplify_match.rs:6:28: 6:29 - // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } - StorageDead(_2); // scope 0 at $DIR/simplify_match.rs:6:30: 6:31 - goto -> bb1; // scope 0 at $DIR/simplify_match.rs:7:9: 7:13 - } - - bb1: { - _0 = const (); // scope 0 at $DIR/simplify_match.rs:8:18: 8:20 - // ty::Const - // + ty: () - // + val: Value(Scalar()) - // mir::Constant - // + span: $DIR/simplify_match.rs:8:18: 8:20 - // + literal: Const { ty: (), val: Value(Scalar()) } - goto -> bb3; // scope 0 at $DIR/simplify_match.rs:6:5: 9:6 - } - - bb2: { - _0 = const noop() -> bb3; // scope 0 at $DIR/simplify_match.rs:7:17: 7:23 - // ty::Const - // + ty: fn() {noop} - // + val: Value(Scalar()) - // mir::Constant - // + span: $DIR/simplify_match.rs:7:17: 7:21 - // + literal: Const { ty: fn() {noop}, val: Value(Scalar()) } - } - - bb3: { - StorageDead(_1); // scope 0 at $DIR/simplify_match.rs:10:1: 10:2 - return; // scope 0 at $DIR/simplify_match.rs:10:2: 10:2 - } - } - -- cgit 1.4.1-3-g733a5