rust/tests/mir-opt/const_goto.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
279 B
Rust
Raw Normal View History

// 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);
}