summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-01-18 17:57:50 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2024-02-09 21:13:51 +0000
commite132cac3c45217f5f2b730ddd684fdd4700ffc4c (patch)
treee171f3ffc6a7f9d92c1ff89c47f03ad8172c361c /tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
parentf4cfd872028398da2b2d85c368c51f4d007dc6af (diff)
downloadrust-e132cac3c45217f5f2b730ddd684fdd4700ffc4c.tar.gz
rust-e132cac3c45217f5f2b730ddd684fdd4700ffc4c.zip
Enable by default.
Diffstat (limited to 'tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir')
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir113
1 files changed, 46 insertions, 67 deletions
diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
index 0a005a460e8..a16e9cd9e51 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
@@ -8,21 +8,20 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     let mut _4: std::ops::Range<usize>;
     let mut _5: std::ops::Range<usize>;
     let mut _6: &mut std::ops::Range<usize>;
-    let mut _12: std::option::Option<usize>;
-    let mut _15: isize;
-    let mut _17: usize;
-    let mut _18: bool;
-    let mut _20: &impl Fn(usize, &T);
-    let mut _21: (usize, &T);
-    let _22: ();
+    let mut _14: std::option::Option<usize>;
+    let mut _16: usize;
+    let mut _17: bool;
+    let mut _19: &impl Fn(usize, &T);
+    let mut _20: (usize, &T);
+    let _21: ();
     scope 1 {
         debug iter => _5;
-        let _16: usize;
+        let _15: usize;
         scope 2 {
-            debug i => _16;
-            let _19: &T;
+            debug i => _15;
+            let _18: &T;
             scope 3 {
-                debug x => _19;
+                debug x => _18;
             }
         }
         scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
@@ -32,10 +31,10 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
                 let mut _7: &usize;
                 let mut _8: &usize;
                 let mut _11: bool;
-                let _13: usize;
-                let mut _14: usize;
+                let _12: usize;
+                let mut _13: usize;
                 scope 7 {
-                    debug old => _13;
+                    debug old => _12;
                     scope 8 {
                     }
                 }
@@ -63,9 +62,9 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     }
 
     bb1: {
-        StorageLive(_12);
+        StorageLive(_14);
         _6 = &mut _5;
-        StorageLive(_13);
+        StorageLive(_12);
         StorageLive(_11);
         StorageLive(_7);
         _7 = &(_5.0: usize);
@@ -78,84 +77,64 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
         _11 = Lt(move _9, move _10);
         StorageDead(_10);
         StorageDead(_9);
-        switchInt(move _11) -> [0: bb2, otherwise: bb3];
+        switchInt(move _11) -> [0: bb2, otherwise: bb4];
     }
 
     bb2: {
         StorageDead(_8);
         StorageDead(_7);
-        _12 = const Option::<usize>::None;
-        goto -> bb5;
+        StorageDead(_11);
+        StorageDead(_12);
+        StorageDead(_14);
+        StorageDead(_5);
+        drop(_2) -> [return: bb3, unwind continue];
     }
 
     bb3: {
-        StorageDead(_8);
-        StorageDead(_7);
-        _13 = (_5.0: usize);
-        StorageLive(_14);
-        _14 = <usize as Step>::forward_unchecked(_13, const 1_usize) -> [return: bb4, unwind: bb12];
+        return;
     }
 
     bb4: {
-        (_5.0: usize) = move _14;
-        StorageDead(_14);
-        _12 = Option::<usize>::Some(_13);
-        goto -> bb5;
+        StorageDead(_8);
+        StorageDead(_7);
+        _12 = (_5.0: usize);
+        StorageLive(_13);
+        _13 = <usize as Step>::forward_unchecked(_12, const 1_usize) -> [return: bb5, unwind: bb8];
     }
 
     bb5: {
-        StorageDead(_11);
+        (_5.0: usize) = move _13;
         StorageDead(_13);
-        _15 = discriminant(_12);
-        switchInt(move _15) -> [0: bb6, 1: bb8, otherwise: bb11];
-    }
-
-    bb6: {
+        _14 = Option::<usize>::Some(_12);
+        StorageDead(_11);
         StorageDead(_12);
-        StorageDead(_5);
-        drop(_2) -> [return: bb7, unwind continue];
-    }
-
-    bb7: {
-        return;
-    }
-
-    bb8: {
-        _16 = ((_12 as Some).0: usize);
-        _17 = Len((*_1));
-        _18 = Lt(_16, _17);
-        assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, _16) -> [success: bb9, unwind: bb12];
+        _15 = ((_14 as Some).0: usize);
+        _16 = Len((*_1));
+        _17 = Lt(_15, _16);
+        assert(move _17, "index out of bounds: the length is {} but the index is {}", move _16, _15) -> [success: bb6, unwind: bb8];
     }
 
-    bb9: {
-        _19 = &(*_1)[_16];
+    bb6: {
+        _18 = &(*_1)[_15];
+        StorageLive(_19);
+        _19 = &_2;
         StorageLive(_20);
-        _20 = &_2;
-        StorageLive(_21);
-        _21 = (_16, _19);
-        _22 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _20, move _21) -> [return: bb10, unwind: bb12];
+        _20 = (_15, _18);
+        _21 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _19, move _20) -> [return: bb7, unwind: bb8];
     }
 
-    bb10: {
-        StorageDead(_21);
+    bb7: {
         StorageDead(_20);
-        StorageDead(_12);
+        StorageDead(_19);
+        StorageDead(_14);
         goto -> bb1;
     }
 
-    bb11: {
-        unreachable;
+    bb8 (cleanup): {
+        drop(_2) -> [return: bb9, unwind terminate(cleanup)];
     }
 
-    bb12 (cleanup): {
-        drop(_2) -> [return: bb13, unwind terminate(cleanup)];
-    }
-
-    bb13 (cleanup): {
+    bb9 (cleanup): {
         resume;
     }
 }
-
-ALLOC0 (size: 16, align: 8) {
-    00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
-}