summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir
blob: 210f9d6a12403a06ad8bd09ef341f7988c4aa65b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// MIR for `slice_index_usize` after PreCodegen

fn slice_index_usize(_1: &[u32], _2: usize) -> u32 {
    debug slice => _1;
    debug index => _2;
    let mut _0: u32;
    let mut _3: usize;
    let mut _4: bool;

    bb0: {
        _3 = Len((*_1));
        _4 = Lt(_2, _3);
        assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind unreachable];
    }

    bb1: {
        _0 = (*_1)[_2];
        return;
    }
}