summary refs log tree commit diff
path: root/src/test/mir-opt/simple-match.rs
blob: fc1a3bb1bf453fde84b2b91b76d9d6cb771bc7c6 (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
// Test that we don't generate unnecessarily large MIR for very simple matches

fn match_bool(x: bool) -> usize {
    match x {
        true => 10,
        _ => 20,
    }
}

fn main() {}


// END RUST SOURCE
// START rustc.match_bool.mir_map.0.mir
// bb0: {
//     FakeRead(ForMatchedPlace, _1);
//     switchInt(_1) -> [false: bb3, otherwise: bb2];
// }
// bb1 (cleanup): {
//     resume;
// }
// bb2: {
//     falseEdges -> [real: bb4, imaginary: bb3];
// }
// bb3: {
//     _0 = const 20usize;
//     goto -> bb5;
// }
// bb4: {
//     _0 = const 10usize;
//     goto -> bb5;
// }
// bb5: {
//     goto -> bb6;
// }
// bb6: {
//     return;
// }
// END rustc.match_bool.mir_map.0.mir