summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/const_goto.rs
blob: 93cb71c3a0f822b6d83bb1274a639fec69dfbbe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// skip-filecheck
// unit-test: ConstGoto

pub enum Foo {
    A,
    B,
    C,
    D,
    E,
    F,
}

// EMIT_MIR const_goto.issue_77355_opt.ConstGoto.diff
fn issue_77355_opt(num: Foo) -> u64 {
    if matches!(num, Foo::B | Foo::C) { 23 } else { 42 }
}
fn main() {
    issue_77355_opt(Foo::A);
}