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-03-11 15:27:44 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-07-10 16:01:18 +0000
commitb74a144a5fcee833cdcc7ae6c5937f8dbe7f2e80 (patch)
treed1539478bcb76bfe8d421da22a6c95993485aaca /tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
parent341e0f78d1a59e8c9e92016e2ae4ebaabd291d0f (diff)
downloadrust-b74a144a5fcee833cdcc7ae6c5937f8dbe7f2e80.tar.gz
rust-b74a144a5fcee833cdcc7ae6c5937f8dbe7f2e80.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.mir119
1 files changed, 55 insertions, 64 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 3423c5d865d..cb07a2be169 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
@@ -7,43 +7,41 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     let mut _3: usize;
     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 _9: std::option::Option<usize>;
+    let mut _12: isize;
+    let mut _14: usize;
+    let mut _15: bool;
+    let mut _17: &impl Fn(usize, &T);
+    let mut _18: (usize, &T);
+    let _19: ();
+    let mut _20: &mut std::ops::Range<usize>;
     scope 1 {
         debug iter => _5;
-        let _16: usize;
+        let _13: usize;
         scope 2 {
-            debug i => _16;
-            let _19: &T;
+            debug i => _13;
+            let _16: &T;
             scope 3 {
-                debug x => _19;
+                debug x => _16;
             }
         }
         scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
-            debug self => _6;
+            debug self => &_5;
             scope 6 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
-                debug self => _6;
-                let mut _7: &usize;
-                let mut _8: &usize;
-                let mut _11: bool;
-                let _13: usize;
-                let mut _14: usize;
+                debug self => &_5;
+                let mut _8: bool;
+                let _10: usize;
+                let mut _11: usize;
                 scope 7 {
-                    debug old => _13;
+                    debug old => _10;
                     scope 8 {
                     }
                 }
                 scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::lt) {
-                    debug self => _7;
-                    debug other => _8;
-                    let mut _9: usize;
-                    let mut _10: usize;
+                    debug self => &((*_20).0: usize);
+                    debug other => &((*_20).1: usize);
+                    let mut _6: usize;
+                    let mut _7: usize;
                 }
             }
         }
@@ -63,53 +61,46 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     }
 
     bb1: {
-        StorageLive(_12);
-        _6 = &mut _5;
-        StorageLive(_13);
-        StorageLive(_11);
-        StorageLive(_7);
-        _7 = &((*_6).0: usize);
-        StorageLive(_8);
-        _8 = &((*_6).1: usize);
         StorageLive(_9);
-        _9 = (*_7);
         StorageLive(_10);
-        _10 = (*_8);
-        _11 = Lt(move _9, move _10);
-        StorageDead(_10);
-        StorageDead(_9);
-        StorageDead(_8);
+        StorageLive(_8);
+        StorageLive(_6);
+        _6 = (_5.0: usize);
+        StorageLive(_7);
+        _7 = (_5.1: usize);
+        _8 = Lt(move _6, move _7);
         StorageDead(_7);
-        switchInt(move _11) -> [0: bb2, otherwise: bb3];
+        StorageDead(_6);
+        switchInt(move _8) -> [0: bb2, otherwise: bb3];
     }
 
     bb2: {
-        _12 = Option::<usize>::None;
+        _9 = Option::<usize>::None;
         goto -> bb5;
     }
 
     bb3: {
-        _13 = ((*_6).0: usize);
-        StorageLive(_14);
-        _14 = <usize as Step>::forward_unchecked(_13, const 1_usize) -> [return: bb4, unwind: bb12];
+        _10 = (_5.0: usize);
+        StorageLive(_11);
+        _11 = <usize as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind: bb12];
     }
 
     bb4: {
-        ((*_6).0: usize) = move _14;
-        StorageDead(_14);
-        _12 = Option::<usize>::Some(_13);
+        (_5.0: usize) = move _11;
+        StorageDead(_11);
+        _9 = Option::<usize>::Some(_10);
         goto -> bb5;
     }
 
     bb5: {
-        StorageDead(_11);
-        StorageDead(_13);
-        _15 = discriminant(_12);
-        switchInt(move _15) -> [0: bb6, 1: bb8, otherwise: bb11];
+        StorageDead(_8);
+        StorageDead(_10);
+        _12 = discriminant(_9);
+        switchInt(move _12) -> [0: bb6, 1: bb8, otherwise: bb11];
     }
 
     bb6: {
-        StorageDead(_12);
+        StorageDead(_9);
         StorageDead(_5);
         drop(_2) -> [return: bb7, unwind continue];
     }
@@ -119,25 +110,25 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     }
 
     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];
+        _13 = ((_9 as Some).0: usize);
+        _14 = Len((*_1));
+        _15 = Lt(_13, _14);
+        assert(move _15, "index out of bounds: the length is {} but the index is {}", move _14, _13) -> [success: bb9, unwind: bb12];
     }
 
     bb9: {
-        _19 = &(*_1)[_16];
-        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];
+        _16 = &(*_1)[_13];
+        StorageLive(_17);
+        _17 = &_2;
+        StorageLive(_18);
+        _18 = (_13, _16);
+        _19 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _17, move _18) -> [return: bb10, unwind: bb12];
     }
 
     bb10: {
-        StorageDead(_21);
-        StorageDead(_20);
-        StorageDead(_12);
+        StorageDead(_18);
+        StorageDead(_17);
+        StorageDead(_9);
         goto -> bb1;
     }