about summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/checked_ops.use_checked_sub.PreCodegen.after.panic-unwind.mir
blob: 3ef09764b1c5bae4526b6d1a6e8ef7e88952b135 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// MIR for `use_checked_sub` after PreCodegen

fn use_checked_sub(_1: u32, _2: u32) -> () {
    debug x => _1;
    debug rhs => _2;
    let mut _0: ();
    let mut _5: std::option::Option<u32>;
    let _7: ();
    scope 1 {
        debug delta => _6;
        let _6: u32;
        scope 2 (inlined core::num::<impl u32>::checked_sub) {
            let mut _3: bool;
            let mut _4: u32;
        }
    }

    bb0: {
        StorageLive(_5);
        StorageLive(_3);
        _3 = Lt(copy _1, copy _2);
        switchInt(move _3) -> [0: bb1, otherwise: bb2];
    }

    bb1: {
        StorageLive(_4);
        _4 = SubUnchecked(copy _1, copy _2);
        _5 = Option::<u32>::Some(move _4);
        StorageDead(_4);
        StorageDead(_3);
        _6 = copy ((_5 as Some).0: u32);
        _7 = do_something(move _6) -> [return: bb3, unwind continue];
    }

    bb2: {
        StorageDead(_3);
        goto -> bb3;
    }

    bb3: {
        StorageDead(_5);
        return;
    }
}