summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir
blob: b99b0b99559a55f950945ae9dc2681e7ec09bef9 (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
107
108
109
110
111
// MIR for `full_tested_match` after built

fn full_tested_match() -> () {
    let mut _0: ();
    let mut _1: (i32, i32);
    let mut _2: std::option::Option<i32>;
    let mut _3: isize;
    let mut _4: &std::option::Option<i32>;
    let _5: i32;
    let _6: &i32;
    let mut _7: bool;
    let mut _8: i32;
    let _9: i32;
    let mut _10: i32;
    scope 1 {
    }
    scope 2 {
        debug x => _5;
        debug x => _6;
    }
    scope 3 {
        debug y => _9;
    }

    bb0: {
        StorageLive(_1);
        StorageLive(_2);
        _2 = Option::<i32>::Some(const 42_i32);
        PlaceMention(_2);
        _3 = discriminant(_2);
        switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4];
    }

    bb1: {
        _1 = (const 3_i32, const 3_i32);
        goto -> bb11;
    }

    bb2: {
        falseEdge -> [real: bb5, imaginary: bb3];
    }

    bb3: {
        falseEdge -> [real: bb10, imaginary: bb1];
    }

    bb4: {
        FakeRead(ForMatchedPlace(None), _2);
        unreachable;
    }

    bb5: {
        StorageLive(_6);
        _6 = &((_2 as Some).0: i32);
        _4 = &fake _2;
        StorageLive(_7);
        _7 = guard() -> [return: bb6, unwind: bb12];
    }

    bb6: {
        switchInt(move _7) -> [0: bb8, otherwise: bb7];
    }

    bb7: {
        StorageDead(_7);
        FakeRead(ForMatchGuard, _4);
        FakeRead(ForGuardBinding, _6);
        StorageLive(_5);
        _5 = ((_2 as Some).0: i32);
        StorageLive(_8);
        _8 = _5;
        _1 = (const 1_i32, move _8);
        StorageDead(_8);
        StorageDead(_5);
        StorageDead(_6);
        goto -> bb11;
    }

    bb8: {
        goto -> bb9;
    }

    bb9: {
        StorageDead(_7);
        StorageDead(_6);
        goto -> bb3;
    }

    bb10: {
        StorageLive(_9);
        _9 = ((_2 as Some).0: i32);
        StorageLive(_10);
        _10 = _9;
        _1 = (const 2_i32, move _10);
        StorageDead(_10);
        StorageDead(_9);
        goto -> bb11;
    }

    bb11: {
        PlaceMention(_1);
        StorageDead(_2);
        StorageDead(_1);
        _0 = const ();
        return;
    }

    bb12 (cleanup): {
        resume;
    }
}