about summary refs log tree commit diff
path: root/src/test/mir-opt
diff options
context:
space:
mode:
authorCaio <c410.f3r@gmail.com>2021-08-08 11:49:13 -0300
committerCaio <c410.f3r@gmail.com>2021-08-15 16:18:26 -0300
commit6aa9937a768bf13e5f7bd0ee6dd8579403b39058 (patch)
treead4c8d3c2233b953d6088456650d26972c3d581b /src/test/mir-opt
parent2d9f2eae84dc3988c5463fdd1b124a9b695447d7 (diff)
Introduce hir::ExprKind::Let - Take 2
Diffstat (limited to 'src/test/mir-opt')
-rw-r--r--src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff46
-rw-r--r--src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir66
-rw-r--r--src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff18
-rw-r--r--src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff14
-rw-r--r--src/test/mir-opt/unreachable.main.UnreachablePropagation.diff11
-rw-r--r--src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff13
-rw-r--r--src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff17
-rw-r--r--src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff27
-rw-r--r--src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff6
-rw-r--r--src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff6
-rw-r--r--src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir18
11 files changed, 131 insertions, 111 deletions
diff --git a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
index 3a50ed224b5..a7e4a131bfb 100644
--- a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
+++ b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
@@ -94,35 +94,34 @@
       bb7: {
           StorageLive(_10);                // scope 2 at $DIR/funky_arms.rs:24:17: 24:26
           _10 = ((_7 as Some).0: usize);   // scope 2 at $DIR/funky_arms.rs:24:17: 24:26
-          StorageLive(_11);                // scope 3 at $DIR/funky_arms.rs:26:43: 26:46
-          _11 = &mut (*_1);                // scope 3 at $DIR/funky_arms.rs:26:43: 26:46
-          StorageLive(_12);                // scope 3 at $DIR/funky_arms.rs:26:48: 26:51
-          _12 = _2;                        // scope 3 at $DIR/funky_arms.rs:26:48: 26:51
-          StorageLive(_13);                // scope 3 at $DIR/funky_arms.rs:26:53: 26:57
-          _13 = _6;                        // scope 3 at $DIR/funky_arms.rs:26:53: 26:57
-          StorageLive(_14);                // scope 3 at $DIR/funky_arms.rs:26:59: 26:79
-          StorageLive(_15);                // scope 3 at $DIR/funky_arms.rs:26:59: 26:75
-          StorageLive(_16);                // scope 3 at $DIR/funky_arms.rs:26:59: 26:68
-          _16 = _10;                       // scope 3 at $DIR/funky_arms.rs:26:59: 26:68
-          _15 = move _16 as u32 (Misc);    // scope 3 at $DIR/funky_arms.rs:26:59: 26:75
-          StorageDead(_16);                // scope 3 at $DIR/funky_arms.rs:26:74: 26:75
-          _14 = Add(move _15, const 1_u32); // scope 3 at $DIR/funky_arms.rs:26:59: 26:79
-          StorageDead(_15);                // scope 3 at $DIR/funky_arms.rs:26:78: 26:79
-          StorageLive(_17);                // scope 3 at $DIR/funky_arms.rs:26:81: 26:86
-          _17 = _3;                        // scope 3 at $DIR/funky_arms.rs:26:81: 26:86
-          _0 = float_to_exponential_common_exact::<T>(move _11, move _12, move _13, move _14, move _17) -> bb8; // scope 3 at $DIR/funky_arms.rs:26:9: 26:87
+          StorageLive(_11);                // scope 2 at $DIR/funky_arms.rs:26:43: 26:46
+          _11 = &mut (*_1);                // scope 2 at $DIR/funky_arms.rs:26:43: 26:46
+          StorageLive(_12);                // scope 2 at $DIR/funky_arms.rs:26:48: 26:51
+          _12 = _2;                        // scope 2 at $DIR/funky_arms.rs:26:48: 26:51
+          StorageLive(_13);                // scope 2 at $DIR/funky_arms.rs:26:53: 26:57
+          _13 = _6;                        // scope 2 at $DIR/funky_arms.rs:26:53: 26:57
+          StorageLive(_14);                // scope 2 at $DIR/funky_arms.rs:26:59: 26:79
+          StorageLive(_15);                // scope 2 at $DIR/funky_arms.rs:26:59: 26:75
+          StorageLive(_16);                // scope 2 at $DIR/funky_arms.rs:26:59: 26:68
+          _16 = _10;                       // scope 2 at $DIR/funky_arms.rs:26:59: 26:68
+          _15 = move _16 as u32 (Misc);    // scope 2 at $DIR/funky_arms.rs:26:59: 26:75
+          StorageDead(_16);                // scope 2 at $DIR/funky_arms.rs:26:74: 26:75
+          _14 = Add(move _15, const 1_u32); // scope 2 at $DIR/funky_arms.rs:26:59: 26:79
+          StorageDead(_15);                // scope 2 at $DIR/funky_arms.rs:26:78: 26:79
+          StorageLive(_17);                // scope 2 at $DIR/funky_arms.rs:26:81: 26:86
+          _17 = _3;                        // scope 2 at $DIR/funky_arms.rs:26:81: 26:86
+          _0 = float_to_exponential_common_exact::<T>(move _11, move _12, move _13, move _14, move _17) -> bb8; // scope 2 at $DIR/funky_arms.rs:26:9: 26:87
                                            // mir::Constant
                                            // + span: $DIR/funky_arms.rs:26:9: 26:42
                                            // + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut std::fmt::Formatter<'s>, &'t0 T, core::num::flt2dec::Sign, u32, bool) -> std::result::Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(Scalar(<ZST>)) }
       }
   
       bb8: {
-          StorageDead(_17);                // scope 3 at $DIR/funky_arms.rs:26:86: 26:87
-          StorageDead(_14);                // scope 3 at $DIR/funky_arms.rs:26:86: 26:87
-          StorageDead(_13);                // scope 3 at $DIR/funky_arms.rs:26:86: 26:87
-          StorageDead(_12);                // scope 3 at $DIR/funky_arms.rs:26:86: 26:87
-          StorageDead(_11);                // scope 3 at $DIR/funky_arms.rs:26:86: 26:87
-          StorageDead(_10);                // scope 2 at $DIR/funky_arms.rs:27:5: 27:6
+          StorageDead(_17);                // scope 2 at $DIR/funky_arms.rs:26:86: 26:87
+          StorageDead(_14);                // scope 2 at $DIR/funky_arms.rs:26:86: 26:87
+          StorageDead(_13);                // scope 2 at $DIR/funky_arms.rs:26:86: 26:87
+          StorageDead(_12);                // scope 2 at $DIR/funky_arms.rs:26:86: 26:87
+          StorageDead(_11);                // scope 2 at $DIR/funky_arms.rs:26:86: 26:87
           goto -> bb10;                    // scope 2 at $DIR/funky_arms.rs:24:5: 29:6
       }
   
@@ -135,6 +134,7 @@
       }
   
       bb10: {
+          StorageDead(_10);                // scope 2 at $DIR/funky_arms.rs:29:5: 29:6
           StorageDead(_6);                 // scope 1 at $DIR/funky_arms.rs:30:1: 30:2
           StorageDead(_4);                 // scope 0 at $DIR/funky_arms.rs:30:1: 30:2
           StorageDead(_7);                 // scope 0 at $DIR/funky_arms.rs:30:1: 30:2
diff --git a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir
index 488fcb5dd70..0417ed8c88b 100644
--- a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir
+++ b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir
@@ -26,7 +26,7 @@ fn main() -> () {
         _8 = const false;                // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
         StorageLive(_1);                 // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
         StorageLive(_2);                 // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
-        _2 = cond() -> [return: bb1, unwind: bb11]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
+        _2 = cond() -> [return: bb1, unwind: bb12]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:8:8: 8:12
                                          // + literal: Const { ty: fn() -> bool {cond}, val: Value(Scalar(<ZST>)) }
@@ -42,12 +42,12 @@ fn main() -> () {
         _4 = K;                          // scope 1 at $DIR/issue-41888.rs:9:18: 9:19
         _3 = E::F(move _4);              // scope 1 at $DIR/issue-41888.rs:9:13: 9:20
         StorageDead(_4);                 // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
-        goto -> bb14;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        goto -> bb15;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
     }
 
     bb3: {
         _0 = const ();                   // scope 1 at $DIR/issue-41888.rs:14:6: 14:6
-        goto -> bb8;                     // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
+        goto -> bb9;                     // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
     }
 
     bb4: {
@@ -69,17 +69,21 @@ fn main() -> () {
         StorageLive(_6);                 // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
         _9 = const false;                // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
         _6 = move ((_1 as F).0: K);      // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
-        _0 = const ();                   // scope 2 at $DIR/issue-41888.rs:10:29: 13:10
-        StorageDead(_6);                 // scope 1 at $DIR/issue-41888.rs:13:9: 13:10
+        _0 = const ();                   // scope 1 at $DIR/issue-41888.rs:10:29: 13:10
         goto -> bb8;                     // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
     }
 
     bb8: {
-        StorageDead(_2);                 // scope 1 at $DIR/issue-41888.rs:14:5: 14:6
-        goto -> bb20;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        StorageDead(_6);                 // scope 1 at $DIR/issue-41888.rs:13:9: 13:10
+        goto -> bb9;                     // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
     }
 
     bb9: {
+        StorageDead(_2);                 // scope 1 at $DIR/issue-41888.rs:14:5: 14:6
+        goto -> bb21;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+    }
+
+    bb10: {
         _7 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
         _8 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
         _9 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
@@ -87,27 +91,27 @@ fn main() -> () {
         return;                          // scope 0 at $DIR/issue-41888.rs:15:2: 15:2
     }
 
-    bb10 (cleanup): {
-        goto -> bb11;                    // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
-    }
-
     bb11 (cleanup): {
-        goto -> bb12;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        goto -> bb12;                    // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
     }
 
     bb12 (cleanup): {
-        resume;                          // scope 0 at $DIR/issue-41888.rs:6:1: 15:2
+        goto -> bb13;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb13 (cleanup): {
+        resume;                          // scope 0 at $DIR/issue-41888.rs:6:1: 15:2
+    }
+
+    bb14 (cleanup): {
         _7 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
         _8 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
         _9 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
         _1 = move _3;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
-        goto -> bb10;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        goto -> bb11;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
     }
 
-    bb14: {
+    bb15: {
         _7 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
         _8 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
         _9 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
@@ -115,38 +119,38 @@ fn main() -> () {
         goto -> bb4;                     // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
     }
 
-    bb15: {
+    bb16: {
         _7 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
-        goto -> bb9;                     // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        goto -> bb10;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
-    bb16 (cleanup): {
-        goto -> bb12;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+    bb17 (cleanup): {
+        goto -> bb13;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
-    bb17: {
-        drop(_1) -> [return: bb15, unwind: bb12]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+    bb18: {
+        drop(_1) -> [return: bb16, unwind: bb13]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
-    bb18 (cleanup): {
-        drop(_1) -> bb12;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+    bb19 (cleanup): {
+        drop(_1) -> bb13;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
-    bb19: {
+    bb20: {
         _10 = discriminant(_1);          // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
-        switchInt(move _10) -> [0_isize: bb15, otherwise: bb17]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        switchInt(move _10) -> [0_isize: bb16, otherwise: bb18]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
-    bb20: {
-        switchInt(_7) -> [false: bb15, otherwise: bb19]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+    bb21: {
+        switchInt(_7) -> [false: bb16, otherwise: bb20]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
-    bb21 (cleanup): {
+    bb22 (cleanup): {
         _11 = discriminant(_1);          // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
-        switchInt(move _11) -> [0_isize: bb16, otherwise: bb18]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        switchInt(move _11) -> [0_isize: bb17, otherwise: bb19]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
-    bb22 (cleanup): {
-        switchInt(_7) -> [false: bb12, otherwise: bb21]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+    bb23 (cleanup): {
+        switchInt(_7) -> [false: bb13, otherwise: bb22]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 }
diff --git a/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff b/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
index 4d1b6bedd5f..89ba5eeeef4 100644
--- a/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
+++ b/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
@@ -13,8 +13,8 @@
           let _4: u32;                     // in scope 1 at $DIR/issue-75439.rs:9:27: 9:29
           scope 3 {
               debug ip => _4;              // in scope 3 at $DIR/issue-75439.rs:9:27: 9:29
-              scope 4 {
-              }
+          }
+          scope 4 {
           }
       }
       scope 2 {
@@ -49,7 +49,7 @@
       }
   
       bb5: {
-          StorageLive(_5);                 // scope 3 at $DIR/issue-75439.rs:10:14: 10:38
+          StorageLive(_5);                 // scope 1 at $DIR/issue-75439.rs:10:14: 10:38
           StorageLive(_6);                 // scope 4 at $DIR/issue-75439.rs:10:33: 10:35
           _6 = _4;                         // scope 4 at $DIR/issue-75439.rs:10:33: 10:35
           _5 = transmute::<u32, [u8; 4]>(move _6) -> bb8; // scope 4 at $DIR/issue-75439.rs:10:23: 10:36
@@ -61,25 +61,25 @@
       bb6: {
           StorageLive(_4);                 // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
           _4 = _2[3 of 4];                 // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
-          goto -> bb5;                     // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
+          goto -> bb5;                     // scope 1 at $DIR/issue-75439.rs:9:12: 9:30
       }
   
       bb7: {
           StorageLive(_4);                 // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
           _4 = _2[3 of 4];                 // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
-          goto -> bb5;                     // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
+          goto -> bb5;                     // scope 1 at $DIR/issue-75439.rs:9:12: 9:30
       }
   
       bb8: {
           StorageDead(_6);                 // scope 4 at $DIR/issue-75439.rs:10:35: 10:36
-          ((_0 as Some).0: [u8; 4]) = move _5; // scope 3 at $DIR/issue-75439.rs:10:9: 10:39
-          discriminant(_0) = 1;            // scope 3 at $DIR/issue-75439.rs:10:9: 10:39
-          StorageDead(_5);                 // scope 3 at $DIR/issue-75439.rs:10:38: 10:39
-          StorageDead(_4);                 // scope 1 at $DIR/issue-75439.rs:11:5: 11:6
+          ((_0 as Some).0: [u8; 4]) = move _5; // scope 1 at $DIR/issue-75439.rs:10:9: 10:39
+          discriminant(_0) = 1;            // scope 1 at $DIR/issue-75439.rs:10:9: 10:39
+          StorageDead(_5);                 // scope 1 at $DIR/issue-75439.rs:10:38: 10:39
           goto -> bb9;                     // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
       }
   
       bb9: {
+          StorageDead(_4);                 // scope 1 at $DIR/issue-75439.rs:13:5: 13:6
           StorageDead(_2);                 // scope 0 at $DIR/issue-75439.rs:14:1: 14:2
           return;                          // scope 0 at $DIR/issue-75439.rs:14:2: 14:2
       }
diff --git a/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff b/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff
index 8b6e38843a8..41a6fe30412 100644
--- a/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff
+++ b/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff
@@ -37,17 +37,17 @@
       bb2: {
           StorageLive(_6);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
           _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
--         StorageLive(_7);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
--         StorageLive(_8);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
--         _8 = _6;                         // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
--         _7 = Gt(move _8, const 42_u8);   // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
--         StorageDead(_8);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20
--         StorageDead(_7);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:7:9: 7:10
-          StorageDead(_6);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6
+-         StorageLive(_7);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
+-         StorageLive(_8);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
+-         _8 = _6;                         // scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
+-         _7 = Gt(move _8, const 42_u8);   // scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
+-         StorageDead(_8);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20
+-         StorageDead(_7);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:7:9: 7:10
           goto -> bb3;                     // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
       }
   
       bb3: {
+          StorageDead(_6);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6
           drop(_1) -> bb4;                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:1: 9:2
       }
   
diff --git a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff
index 23a3fbd5f46..ff05951a99b 100644
--- a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff
+++ b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff
@@ -6,15 +6,15 @@
       let mut _1: std::option::Option<Empty>; // in scope 0 at $DIR/unreachable.rs:9:23: 9:30
       let mut _2: isize;                   // in scope 0 at $DIR/unreachable.rs:9:12: 9:20
       let _3: Empty;                       // in scope 0 at $DIR/unreachable.rs:9:17: 9:19
+      let mut _4: i32;                     // in scope 0 at $DIR/unreachable.rs:10:13: 10:19
       let _5: ();                          // in scope 0 at $DIR/unreachable.rs:12:9: 16:10
       let mut _6: bool;                    // in scope 0 at $DIR/unreachable.rs:12:12: 12:16
       let mut _7: !;                       // in scope 0 at $DIR/unreachable.rs:18:9: 18:21
       scope 1 {
           debug _x => _3;                  // in scope 1 at $DIR/unreachable.rs:9:17: 9:19
-          let mut _4: i32;                 // in scope 1 at $DIR/unreachable.rs:10:13: 10:19
-          scope 2 {
-              debug _y => _4;              // in scope 2 at $DIR/unreachable.rs:10:13: 10:19
-          }
+      }
+      scope 2 {
+          debug _y => _4;                  // in scope 2 at $DIR/unreachable.rs:10:13: 10:19
       }
   
       bb0: {
@@ -33,6 +33,7 @@
   
       bb2: {
           _0 = const ();                   // scope 0 at $DIR/unreachable.rs:19:6: 19:6
+          StorageDead(_3);                 // scope 0 at $DIR/unreachable.rs:19:5: 19:6
           StorageDead(_1);                 // scope 0 at $DIR/unreachable.rs:20:1: 20:2
           return;                          // scope 0 at $DIR/unreachable.rs:20:2: 20:2
 -     }
@@ -40,7 +41,7 @@
 -     bb3: {
 -         StorageLive(_3);                 // scope 0 at $DIR/unreachable.rs:9:17: 9:19
 -         _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable.rs:9:17: 9:19
--         StorageLive(_4);                 // scope 1 at $DIR/unreachable.rs:10:13: 10:19
+-         StorageLive(_4);                 // scope 0 at $DIR/unreachable.rs:10:13: 10:19
 -         StorageLive(_5);                 // scope 2 at $DIR/unreachable.rs:12:9: 16:10
 -         StorageLive(_6);                 // scope 2 at $DIR/unreachable.rs:12:12: 12:16
 -         _6 = const true;                 // scope 2 at $DIR/unreachable.rs:12:12: 12:16
diff --git a/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff
index 3eda1831705..b94441d5919 100644
--- a/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff
+++ b/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff
@@ -6,17 +6,17 @@
       let mut _1: std::option::Option<Empty>; // in scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
       let mut _2: isize;                   // in scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
       let _3: Empty;                       // in scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
+      let mut _4: i32;                     // in scope 0 at $DIR/unreachable_asm.rs:12:13: 12:19
       let _5: ();                          // in scope 0 at $DIR/unreachable_asm.rs:14:9: 18:10
       let mut _6: bool;                    // in scope 0 at $DIR/unreachable_asm.rs:14:12: 14:16
       let _7: ();                          // in scope 0 at $DIR/unreachable_asm.rs:21:9: 21:37
       let mut _8: !;                       // in scope 0 at $DIR/unreachable_asm.rs:22:9: 22:21
       scope 1 {
           debug _x => _3;                  // in scope 1 at $DIR/unreachable_asm.rs:11:17: 11:19
-          let mut _4: i32;                 // in scope 1 at $DIR/unreachable_asm.rs:12:13: 12:19
-          scope 2 {
-              debug _y => _4;              // in scope 2 at $DIR/unreachable_asm.rs:12:13: 12:19
-              scope 3 {
-              }
+      }
+      scope 2 {
+          debug _y => _4;                  // in scope 2 at $DIR/unreachable_asm.rs:12:13: 12:19
+          scope 3 {
           }
       }
   
@@ -35,6 +35,7 @@
   
       bb2: {
           _0 = const ();                   // scope 0 at $DIR/unreachable_asm.rs:23:6: 23:6
+          StorageDead(_3);                 // scope 0 at $DIR/unreachable_asm.rs:23:5: 23:6
           StorageDead(_1);                 // scope 0 at $DIR/unreachable_asm.rs:24:1: 24:2
           return;                          // scope 0 at $DIR/unreachable_asm.rs:24:2: 24:2
       }
@@ -42,7 +43,7 @@
       bb3: {
           StorageLive(_3);                 // scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
           _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
-          StorageLive(_4);                 // scope 1 at $DIR/unreachable_asm.rs:12:13: 12:19
+          StorageLive(_4);                 // scope 0 at $DIR/unreachable_asm.rs:12:13: 12:19
           StorageLive(_5);                 // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
           StorageLive(_6);                 // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
           _6 = const true;                 // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
diff --git a/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff
index d0d52e869d6..666843eab3d 100644
--- a/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff
+++ b/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff
@@ -6,6 +6,7 @@
       let mut _1: std::option::Option<Empty>; // in scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
       let mut _2: isize;                   // in scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
       let _3: Empty;                       // in scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
+      let mut _4: i32;                     // in scope 0 at $DIR/unreachable_asm_2.rs:12:13: 12:19
       let _5: ();                          // in scope 0 at $DIR/unreachable_asm_2.rs:14:9: 22:10
       let mut _6: bool;                    // in scope 0 at $DIR/unreachable_asm_2.rs:14:12: 14:16
       let _7: ();                          // in scope 0 at $DIR/unreachable_asm_2.rs:16:13: 16:41
@@ -13,13 +14,12 @@
       let mut _9: !;                       // in scope 0 at $DIR/unreachable_asm_2.rs:24:9: 24:21
       scope 1 {
           debug _x => _3;                  // in scope 1 at $DIR/unreachable_asm_2.rs:11:17: 11:19
-          let mut _4: i32;                 // in scope 1 at $DIR/unreachable_asm_2.rs:12:13: 12:19
-          scope 2 {
-              debug _y => _4;              // in scope 2 at $DIR/unreachable_asm_2.rs:12:13: 12:19
-              scope 3 {
-              }
-              scope 4 {
-              }
+      }
+      scope 2 {
+          debug _y => _4;                  // in scope 2 at $DIR/unreachable_asm_2.rs:12:13: 12:19
+          scope 3 {
+          }
+          scope 4 {
           }
       }
   
@@ -38,6 +38,7 @@
   
       bb2: {
           _0 = const ();                   // scope 0 at $DIR/unreachable_asm_2.rs:25:6: 25:6
+          StorageDead(_3);                 // scope 0 at $DIR/unreachable_asm_2.rs:25:5: 25:6
           StorageDead(_1);                 // scope 0 at $DIR/unreachable_asm_2.rs:26:1: 26:2
           return;                          // scope 0 at $DIR/unreachable_asm_2.rs:26:2: 26:2
       }
@@ -45,7 +46,7 @@
       bb3: {
           StorageLive(_3);                 // scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
           _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
-          StorageLive(_4);                 // scope 1 at $DIR/unreachable_asm_2.rs:12:13: 12:19
+          StorageLive(_4);                 // scope 0 at $DIR/unreachable_asm_2.rs:12:13: 12:19
           StorageLive(_5);                 // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
           StorageLive(_6);                 // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
           _6 = const true;                 // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
diff --git a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
index 2c0cc04085e..32a067f2245 100644
--- a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
+++ b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
@@ -34,6 +34,7 @@
   
       bb2: {
           _0 = const ();                   // scope 1 at $DIR/unreachable_diverging.rs:19:6: 19:6
+          StorageDead(_4);                 // scope 1 at $DIR/unreachable_diverging.rs:19:5: 19:6
           StorageDead(_1);                 // scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2
           StorageDead(_2);                 // scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2
           return;                          // scope 0 at $DIR/unreachable_diverging.rs:20:2: 20:2
@@ -42,31 +43,31 @@
       bb3: {
           StorageLive(_4);                 // scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
           _4 = move ((_2 as Some).0: Empty); // scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
-          StorageLive(_5);                 // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
-          StorageLive(_6);                 // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13
-          _6 = _1;                         // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13
--         switchInt(move _6) -> [false: bb5, otherwise: bb4]; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
-+         goto -> bb4;                     // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
+          StorageLive(_5);                 // scope 1 at $DIR/unreachable_diverging.rs:15:9: 17:10
+          StorageLive(_6);                 // scope 1 at $DIR/unreachable_diverging.rs:15:12: 15:13
+          _6 = _1;                         // scope 1 at $DIR/unreachable_diverging.rs:15:12: 15:13
+-         switchInt(move _6) -> [false: bb5, otherwise: bb4]; // scope 1 at $DIR/unreachable_diverging.rs:15:9: 17:10
++         goto -> bb4;                     // scope 1 at $DIR/unreachable_diverging.rs:15:9: 17:10
       }
   
       bb4: {
--         _5 = loop_forever() -> bb6;      // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27
-+         _5 = loop_forever() -> bb5;      // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27
+-         _5 = loop_forever() -> bb6;      // scope 1 at $DIR/unreachable_diverging.rs:16:13: 16:27
++         _5 = loop_forever() -> bb5;      // scope 1 at $DIR/unreachable_diverging.rs:16:13: 16:27
                                            // mir::Constant
                                            // + span: $DIR/unreachable_diverging.rs:16:13: 16:25
                                            // + literal: Const { ty: fn() {loop_forever}, val: Value(Scalar(<ZST>)) }
       }
   
       bb5: {
--         _5 = const ();                   // scope 2 at $DIR/unreachable_diverging.rs:17:10: 17:10
--         goto -> bb6;                     // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
+-         _5 = const ();                   // scope 1 at $DIR/unreachable_diverging.rs:17:10: 17:10
+-         goto -> bb6;                     // scope 1 at $DIR/unreachable_diverging.rs:15:9: 17:10
 -     }
 - 
 -     bb6: {
-          StorageDead(_6);                 // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
-          StorageDead(_5);                 // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
-          StorageLive(_7);                 // scope 2 at $DIR/unreachable_diverging.rs:18:9: 18:22
-          unreachable;                     // scope 2 at $DIR/unreachable_diverging.rs:18:15: 18:19
+          StorageDead(_6);                 // scope 1 at $DIR/unreachable_diverging.rs:17:9: 17:10
+          StorageDead(_5);                 // scope 1 at $DIR/unreachable_diverging.rs:17:9: 17:10
+          StorageLive(_7);                 // scope 1 at $DIR/unreachable_diverging.rs:18:9: 18:22
+          unreachable;                     // scope 1 at $DIR/unreachable_diverging.rs:18:15: 18:19
       }
   }
   
diff --git a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff
index de8a29ea25f..91927dc7f16 100644
--- a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff
+++ b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff
@@ -9,6 +9,8 @@
       let mut _4: isize;                   // in scope 0 at $DIR/while_let_loops.rs:7:15: 7:25
       let mut _5: !;                       // in scope 0 at $DIR/while_let_loops.rs:7:33: 10:6
       let mut _6: !;                       // in scope 0 at $DIR/while_let_loops.rs:7:5: 10:6
+      let _7: ();                          // in scope 0 at $DIR/while_let_loops.rs:7:5: 10:6
+      let mut _8: !;                       // in scope 0 at $DIR/while_let_loops.rs:7:5: 10:6
       scope 1 {
           debug _x => _1;                  // in scope 1 at $DIR/while_let_loops.rs:6:9: 6:15
       }
@@ -25,8 +27,10 @@
       }
   
       bb1: {
+          StorageLive(_7);                 // scope 1 at $DIR/while_let_loops.rs:7:5: 10:6
           nop;                             // scope 1 at $DIR/while_let_loops.rs:7:5: 10:6
-          goto -> bb4;                     // scope 1 at $DIR/while_let_loops.rs:7:5: 10:6
+          StorageDead(_7);                 // scope 1 at $DIR/while_let_loops.rs:10:5: 10:6
+          goto -> bb4;                     // scope 1 at no-location
       }
   
       bb2: {
diff --git a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff
index de8a29ea25f..91927dc7f16 100644
--- a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff
+++ b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff
@@ -9,6 +9,8 @@
       let mut _4: isize;                   // in scope 0 at $DIR/while_let_loops.rs:7:15: 7:25
       let mut _5: !;                       // in scope 0 at $DIR/while_let_loops.rs:7:33: 10:6
       let mut _6: !;                       // in scope 0 at $DIR/while_let_loops.rs:7:5: 10:6
+      let _7: ();                          // in scope 0 at $DIR/while_let_loops.rs:7:5: 10:6
+      let mut _8: !;                       // in scope 0 at $DIR/while_let_loops.rs:7:5: 10:6
       scope 1 {
           debug _x => _1;                  // in scope 1 at $DIR/while_let_loops.rs:6:9: 6:15
       }
@@ -25,8 +27,10 @@
       }
   
       bb1: {
+          StorageLive(_7);                 // scope 1 at $DIR/while_let_loops.rs:7:5: 10:6
           nop;                             // scope 1 at $DIR/while_let_loops.rs:7:5: 10:6
-          goto -> bb4;                     // scope 1 at $DIR/while_let_loops.rs:7:5: 10:6
+          StorageDead(_7);                 // scope 1 at $DIR/while_let_loops.rs:10:5: 10:6
+          goto -> bb4;                     // scope 1 at no-location
       }
   
       bb2: {
diff --git a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir b/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir
index bf9c2d138a0..325b8591c73 100644
--- a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir
+++ b/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir
@@ -20,36 +20,40 @@ fn while_loop(_1: bool) -> () {
 
     bb1: {
         StorageDead(_3);                 // scope 0 at $DIR/while-storage.rs:10:21: 10:22
-        switchInt(_2) -> [false: bb6, otherwise: bb2]; // scope 0 at $DIR/while-storage.rs:10:5: 14:6
+        switchInt(move _2) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/while-storage.rs:10:5: 14:6
     }
 
     bb2: {
         StorageLive(_4);                 // scope 0 at $DIR/while-storage.rs:11:12: 11:23
         StorageLive(_5);                 // scope 0 at $DIR/while-storage.rs:11:21: 11:22
         _5 = _1;                         // scope 0 at $DIR/while-storage.rs:11:21: 11:22
-        _4 = get_bool(move _5) -> bb3;   // scope 0 at $DIR/while-storage.rs:11:12: 11:23
+        _4 = get_bool(move _5) -> bb4;   // scope 0 at $DIR/while-storage.rs:11:12: 11:23
                                          // mir::Constant
                                          // + span: $DIR/while-storage.rs:11:12: 11:20
                                          // + literal: Const { ty: fn(bool) -> bool {get_bool}, val: Value(Scalar(<ZST>)) }
     }
 
     bb3: {
-        StorageDead(_5);                 // scope 0 at $DIR/while-storage.rs:11:22: 11:23
-        switchInt(move _4) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/while-storage.rs:11:9: 13:10
+        goto -> bb7;                     // scope 0 at no-location
     }
 
     bb4: {
-        StorageDead(_4);                 // scope 0 at $DIR/while-storage.rs:13:9: 13:10
-        goto -> bb6;                     // scope 0 at no-location
+        StorageDead(_5);                 // scope 0 at $DIR/while-storage.rs:11:22: 11:23
+        switchInt(move _4) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/while-storage.rs:11:9: 13:10
     }
 
     bb5: {
         StorageDead(_4);                 // scope 0 at $DIR/while-storage.rs:13:9: 13:10
+        goto -> bb7;                     // scope 0 at no-location
+    }
+
+    bb6: {
+        StorageDead(_4);                 // scope 0 at $DIR/while-storage.rs:13:9: 13:10
         StorageDead(_2);                 // scope 0 at $DIR/while-storage.rs:14:5: 14:6
         goto -> bb0;                     // scope 0 at $DIR/while-storage.rs:10:5: 14:6
     }
 
-    bb6: {
+    bb7: {
         StorageDead(_2);                 // scope 0 at $DIR/while-storage.rs:14:5: 14:6
         return;                          // scope 0 at $DIR/while-storage.rs:15:2: 15:2
     }