]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/simple-match.rs
Render const pointers in MIR more compactly
[rust.git] / src / test / mir-opt / simple-match.rs
1 // Test that we don't generate unnecessarily large MIR for very simple matches
2
3 fn match_bool(x: bool) -> usize {
4     match x {
5         true => 10,
6         _ => 20,
7     }
8 }
9
10 fn main() {}
11
12
13 // END RUST SOURCE
14 // START rustc.match_bool.mir_map.0.mir
15 // bb0: {
16 //     FakeRead(ForMatchedPlace, _1);
17 //     switchInt(_1) -> [false: bb3, otherwise: bb2];
18 // }
19 // bb1 (cleanup): {
20 //     resume;
21 // }
22 // bb2: {
23 //     falseEdges -> [real: bb4, imaginary: bb3];
24 // }
25 // bb3: {
26 //     _0 = const 20usize;
27 //     goto -> bb5;
28 // }
29 // bb4: {
30 //     _0 = const 10usize;
31 //     goto -> bb5;
32 // }
33 // bb5: {
34 //     goto -> bb6;
35 // }
36 // bb6: {
37 //     return;
38 // }
39 // END rustc.match_bool.mir_map.0.mir