summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/while_storage.while_loop.PreCodegen.after.panic-abort.mir
blob: c04fdeb637d888f6f99eccecabc372eba73b149e (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
45
46
// MIR for `while_loop` after PreCodegen

fn while_loop(_1: bool) -> () {
    debug c => _1;
    let mut _0: ();
    let mut _2: bool;
    let mut _3: bool;

    bb0: {
        goto -> bb1;
    }

    bb1: {
        StorageLive(_2);
        _2 = get_bool(_1) -> [return: bb2, unwind unreachable];
    }

    bb2: {
        switchInt(move _2) -> [0: bb7, otherwise: bb3];
    }

    bb3: {
        StorageLive(_3);
        _3 = get_bool(_1) -> [return: bb4, unwind unreachable];
    }

    bb4: {
        switchInt(move _3) -> [0: bb5, otherwise: bb6];
    }

    bb5: {
        StorageDead(_3);
        StorageDead(_2);
        goto -> bb1;
    }

    bb6: {
        StorageDead(_3);
        goto -> bb7;
    }

    bb7: {
        StorageDead(_2);
        return;
    }
}