rust/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir
Pietro Albini 4668123945
bless mir-opt
To reproduce the changes in this commit locally:

- Run `./x test tidy` and remove all the output files not associated
  with a test file anymore, as reported by tidy.
- Run `./x test tests/mir-opt --bless` to generate the new outputs.
2023-06-12 09:34:17 +02:00

75 lines
4.9 KiB
Rust

// MIR for `range_iter_next` after PreCodegen
fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> {
debug it => _1; // in scope 0 at $DIR/range_iter.rs:+0:24: +0:26
let mut _0: std::option::Option<u32>; // return place in scope 0 at $DIR/range_iter.rs:+0:48: +0:59
scope 1 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) { // at $DIR/range_iter.rs:12:8: 12:14
debug self => _1; // in scope 1 at $SRC_DIR/core/src/iter/range.rs:LL:COL
scope 2 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) { // at $SRC_DIR/core/src/iter/range.rs:LL:COL
debug self => _1; // in scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let mut _2: &u32; // in scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let mut _3: &u32; // in scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let mut _6: bool; // in scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let _7: u32; // in scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let mut _8: u32; // in scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
scope 3 {
debug old => _7; // in scope 3 at $SRC_DIR/core/src/iter/range.rs:LL:COL
scope 4 {
}
}
scope 5 (inlined cmp::impls::<impl PartialOrd for u32>::lt) { // at $SRC_DIR/core/src/iter/range.rs:LL:COL
debug self => _2; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
debug other => _3; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
let mut _4: u32; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
let mut _5: u32; // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
}
}
}
bb0: {
StorageLive(_7); // scope 1 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageLive(_6); // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageLive(_2); // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_2 = &((*_1).0: u32); // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageLive(_3); // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_3 = &((*_1).1: u32); // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageLive(_4); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
_4 = (*_2); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
StorageLive(_5); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
_5 = (*_3); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
_6 = Lt(move _4, move _5); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
StorageDead(_5); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
StorageDead(_4); // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
StorageDead(_3); // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageDead(_2); // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
switchInt(move _6) -> [0: bb1, otherwise: bb2]; // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
}
bb1: {
_0 = Option::<u32>::None; // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
goto -> bb4; // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
}
bb2: {
_7 = ((*_1).0: u32); // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageLive(_8); // scope 3 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_8 = <u32 as Step>::forward_unchecked(_7, const 1_usize) -> [return: bb3, unwind unreachable]; // scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
// + literal: Const { ty: unsafe fn(u32, usize) -> u32 {<u32 as Step>::forward_unchecked}, val: Value(<ZST>) }
}
bb3: {
((*_1).0: u32) = move _8; // scope 3 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageDead(_8); // scope 3 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_0 = Option::<u32>::Some(_7); // scope 3 at $SRC_DIR/core/src/iter/range.rs:LL:COL
goto -> bb4; // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
}
bb4: {
StorageDead(_6); // scope 2 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageDead(_7); // scope 1 at $SRC_DIR/core/src/iter/range.rs:LL:COL
return; // scope 0 at $DIR/range_iter.rs:+2:2: +2:2
}
}