From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- ...nst_switch.too_complex.SeparateConstSwitch.diff | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff (limited to 'src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff') diff --git a/src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff b/src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff new file mode 100644 index 000000000..3ab1c572a --- /dev/null +++ b/src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff @@ -0,0 +1,102 @@ +- // MIR for `too_complex` before SeparateConstSwitch ++ // MIR for `too_complex` after SeparateConstSwitch + + fn too_complex(_1: Result) -> Option { + debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:16: +0:17 + let mut _0: std::option::Option; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:42: +0:53 + let mut _2: std::ops::ControlFlow; // in scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6 + let mut _3: isize; // in scope 0 at $DIR/separate_const_switch.rs:+7:13: +7:18 + let _4: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17 + let mut _5: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:44: +7:45 + let _6: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18 + let mut _7: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:42: +8:43 + let mut _8: isize; // in scope 0 at $DIR/separate_const_switch.rs:+11:9: +11:33 + let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32 + let mut _10: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:42: +11:43 + let _11: usize; // in scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29 + scope 1 { + debug v => _4; // in scope 1 at $DIR/separate_const_switch.rs:+7:16: +7:17 + } + scope 2 { + debug r => _6; // in scope 2 at $DIR/separate_const_switch.rs:+8:17: +8:18 + } + scope 3 { + debug v => _9; // in scope 3 at $DIR/separate_const_switch.rs:+11:31: +11:32 + } + scope 4 { + debug r => _11; // in scope 4 at $DIR/separate_const_switch.rs:+12:28: +12:29 + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6 + _3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16 + switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16 + } + + bb1: { + StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18 + _6 = ((_1 as Err).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18 + StorageLive(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:42: +8:43 + _7 = _6; // scope 2 at $DIR/separate_const_switch.rs:+8:42: +8:43 + Deinit(_2); // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44 + ((_2 as Break).0: usize) = move _7; // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44 + discriminant(_2) = 1; // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44 + StorageDead(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:43: +8:44 + StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44 +- goto -> bb3; // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44 ++ _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6 ++ switchInt(move _8) -> [0_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6 + } + + bb2: { + StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17 + _4 = ((_1 as Ok).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17 + StorageLive(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45 + _5 = _4; // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45 + Deinit(_2); // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46 + ((_2 as Continue).0: i32) = move _5; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46 + discriminant(_2) = 0; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46 + StorageDead(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:45: +7:46 + StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46 +- goto -> bb3; // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46 +- } +- +- bb3: { + _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6 +- switchInt(move _8) -> [0_isize: bb5, otherwise: bb4]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6 ++ switchInt(move _8) -> [0_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6 + } + +- bb4: { ++ bb3: { + StorageLive(_11); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29 + _11 = ((_2 as Break).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29 + Deinit(_0); // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38 + discriminant(_0) = 0; // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38 + StorageDead(_11); // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38 +- goto -> bb6; // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38 ++ goto -> bb5; // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38 + } + +- bb5: { ++ bb4: { + StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32 + _9 = ((_2 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32 + StorageLive(_10); // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43 + _10 = _9; // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43 + Deinit(_0); // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44 + ((_0 as Some).0: i32) = move _10; // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44 + discriminant(_0) = 1; // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44 + StorageDead(_10); // scope 3 at $DIR/separate_const_switch.rs:+11:43: +11:44 + StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44 +- goto -> bb6; // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44 ++ goto -> bb5; // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44 + } + +- bb6: { ++ bb5: { + StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+14:1: +14:2 + return; // scope 0 at $DIR/separate_const_switch.rs:+14:2: +14:2 + } + } + -- cgit v1.2.3