summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/match_test.main.SimplifyCfg-initial.after.mir
blob: 7f8eb82c772feca4ea7828a6b37af912e62622ca (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// MIR for `main` after SimplifyCfg-initial

fn main() -> () {
    let mut _0: ();
    let _1: i32;
    let _3: i32;
    let mut _4: bool;
    let mut _5: bool;
    let mut _6: bool;
    let mut _7: bool;
    let mut _8: &i32;
    let mut _9: bool;
    scope 1 {
        debug x => _1;
        let _2: bool;
        scope 2 {
            debug b => _2;
        }
    }

    bb0: {
        StorageLive(_1);
        _1 = const 3_i32;
        FakeRead(ForLet(None), _1);
        StorageLive(_2);
        _2 = const true;
        FakeRead(ForLet(None), _2);
        StorageLive(_3);
        FakeRead(ForMatchedPlace(None), _1);
        _6 = Le(const 0_i32, _1);
        switchInt(move _6) -> [0: bb4, otherwise: bb1];
    }

    bb1: {
        _7 = Lt(_1, const 10_i32);
        switchInt(move _7) -> [0: bb4, otherwise: bb2];
    }

    bb2: {
        falseEdge -> [real: bb9, imaginary: bb6];
    }

    bb3: {
        _3 = const 3_i32;
        goto -> bb14;
    }

    bb4: {
        _4 = Le(const 10_i32, _1);
        switchInt(move _4) -> [0: bb7, otherwise: bb5];
    }

    bb5: {
        _5 = Le(_1, const 20_i32);
        switchInt(move _5) -> [0: bb7, otherwise: bb6];
    }

    bb6: {
        falseEdge -> [real: bb12, imaginary: bb8];
    }

    bb7: {
        switchInt(_1) -> [4294967295: bb8, otherwise: bb3];
    }

    bb8: {
        falseEdge -> [real: bb13, imaginary: bb3];
    }

    bb9: {
        _8 = &shallow _1;
        StorageLive(_9);
        _9 = _2;
        switchInt(move _9) -> [0: bb11, otherwise: bb10];
    }

    bb10: {
        StorageDead(_9);
        FakeRead(ForMatchGuard, _8);
        _3 = const 0_i32;
        goto -> bb14;
    }

    bb11: {
        StorageDead(_9);
        falseEdge -> [real: bb3, imaginary: bb6];
    }

    bb12: {
        _3 = const 1_i32;
        goto -> bb14;
    }

    bb13: {
        _3 = const 2_i32;
        goto -> bb14;
    }

    bb14: {
        StorageDead(_3);
        _0 = const ();
        StorageDead(_2);
        StorageDead(_1);
        return;
    }
}