diff options
Diffstat (limited to 'src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff')
| -rw-r--r-- | src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff | 98 |
1 files changed, 98 insertions, 0 deletions
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 00000000000..ce32227ed65 --- /dev/null +++ b/src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff @@ -0,0 +1,98 @@ +- // MIR for `too_complex` before SeparateConstSwitch ++ // MIR for `too_complex` after SeparateConstSwitch + + fn too_complex(_1: Result<i32, usize>) -> Option<i32> { + debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:9:16: 9:17 + let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:9:42: 9:53 + let mut _2: std::ops::ControlFlow<usize, i32>; // in scope 0 at $DIR/separate_const_switch.rs:14:11: 19:6 + let mut _3: isize; // in scope 0 at $DIR/separate_const_switch.rs:16:13: 16:18 + let _4: i32; // in scope 0 at $DIR/separate_const_switch.rs:16:16: 16:17 + let mut _5: i32; // in scope 0 at $DIR/separate_const_switch.rs:16:44: 16:45 + let _6: usize; // in scope 0 at $DIR/separate_const_switch.rs:17:17: 17:18 + let mut _7: usize; // in scope 0 at $DIR/separate_const_switch.rs:17:42: 17:43 + let mut _8: isize; // in scope 0 at $DIR/separate_const_switch.rs:20:9: 20:33 + let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:20:31: 20:32 + let mut _10: i32; // in scope 0 at $DIR/separate_const_switch.rs:20:42: 20:43 + let _11: usize; // in scope 0 at $DIR/separate_const_switch.rs:21:28: 21:29 + scope 1 { + debug v => _4; // in scope 1 at $DIR/separate_const_switch.rs:16:16: 16:17 + } + scope 2 { + debug r => _6; // in scope 2 at $DIR/separate_const_switch.rs:17:17: 17:18 + } + scope 3 { + debug v => _9; // in scope 3 at $DIR/separate_const_switch.rs:20:31: 20:32 + } + scope 4 { + debug r => _11; // in scope 4 at $DIR/separate_const_switch.rs:21:28: 21:29 + } + + bb0: { + StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:14:11: 19:6 + _3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:16:13: 16:18 + switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/separate_const_switch.rs:16:13: 16:18 + } + + bb1: { + StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:17:17: 17:18 + _6 = ((_1 as Err).0: usize); // scope 0 at $DIR/separate_const_switch.rs:17:17: 17:18 + StorageLive(_7); // scope 2 at $DIR/separate_const_switch.rs:17:42: 17:43 + _7 = _6; // scope 2 at $DIR/separate_const_switch.rs:17:42: 17:43 + ((_2 as Break).0: usize) = move _7; // scope 2 at $DIR/separate_const_switch.rs:17:23: 17:44 + discriminant(_2) = 1; // scope 2 at $DIR/separate_const_switch.rs:17:23: 17:44 + StorageDead(_7); // scope 2 at $DIR/separate_const_switch.rs:17:43: 17:44 + StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:17:43: 17:44 +- goto -> bb3; // scope 0 at $DIR/separate_const_switch.rs:15:9: 18:10 ++ _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:20:9: 20:33 ++ switchInt(move _8) -> [0_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:20:9: 20:33 + } + + bb2: { + StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:16:16: 16:17 + _4 = ((_1 as Ok).0: i32); // scope 0 at $DIR/separate_const_switch.rs:16:16: 16:17 + StorageLive(_5); // scope 1 at $DIR/separate_const_switch.rs:16:44: 16:45 + _5 = _4; // scope 1 at $DIR/separate_const_switch.rs:16:44: 16:45 + ((_2 as Continue).0: i32) = move _5; // scope 1 at $DIR/separate_const_switch.rs:16:22: 16:46 + discriminant(_2) = 0; // scope 1 at $DIR/separate_const_switch.rs:16:22: 16:46 + StorageDead(_5); // scope 1 at $DIR/separate_const_switch.rs:16:45: 16:46 + StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:16:45: 16:46 +- goto -> bb3; // scope 0 at $DIR/separate_const_switch.rs:15:9: 18:10 +- } +- +- bb3: { + _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:20:9: 20:33 +- switchInt(move _8) -> [0_isize: bb5, otherwise: bb4]; // scope 0 at $DIR/separate_const_switch.rs:20:9: 20:33 ++ switchInt(move _8) -> [0_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:20:9: 20:33 + } + +- bb4: { ++ bb3: { + StorageLive(_11); // scope 0 at $DIR/separate_const_switch.rs:21:28: 21:29 + _11 = ((_2 as Break).0: usize); // scope 0 at $DIR/separate_const_switch.rs:21:28: 21:29 + discriminant(_0) = 0; // scope 4 at $DIR/separate_const_switch.rs:21:34: 21:38 + StorageDead(_11); // scope 0 at $DIR/separate_const_switch.rs:21:37: 21:38 +- goto -> bb6; // scope 0 at $DIR/separate_const_switch.rs:14:5: 22:6 ++ goto -> bb5; // scope 0 at $DIR/separate_const_switch.rs:14:5: 22:6 + } + +- bb5: { ++ bb4: { + StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:20:31: 20:32 + _9 = ((_2 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:20:31: 20:32 + StorageLive(_10); // scope 3 at $DIR/separate_const_switch.rs:20:42: 20:43 + _10 = _9; // scope 3 at $DIR/separate_const_switch.rs:20:42: 20:43 + ((_0 as Some).0: i32) = move _10; // scope 3 at $DIR/separate_const_switch.rs:20:37: 20:44 + discriminant(_0) = 1; // scope 3 at $DIR/separate_const_switch.rs:20:37: 20:44 + StorageDead(_10); // scope 3 at $DIR/separate_const_switch.rs:20:43: 20:44 + StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:20:43: 20:44 +- goto -> bb6; // scope 0 at $DIR/separate_const_switch.rs:14:5: 22:6 ++ goto -> bb5; // scope 0 at $DIR/separate_const_switch.rs:14:5: 22:6 + } + +- bb6: { ++ bb5: { + StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:23:1: 23:2 + return; // scope 0 at $DIR/separate_const_switch.rs:23:2: 23:2 + } + } + |
