about summary refs log tree commit diff
path: root/tests/mir-opt/building/match/simple_match.rs
blob: c8b3d90748afbe0e0d9dd049ab6e9d52761446d2 (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
// skip-filecheck
// Test that we don't generate unnecessarily large MIR for very simple matches

// EMIT_MIR simple_match.match_bool.built.after.mir
fn match_bool(x: bool) -> usize {
    match x {
        true => 10,
        _ => 20,
    }
}

pub enum E1 {
    V1,
    V2,
    V3,
}

// EMIT_MIR simple_match.match_enum.built.after.mir
pub fn match_enum(x: E1) -> bool {
    match x {
        E1::V1 | E1::V2 => true,
        E1::V3 => false,
    }
}

fn main() {}