rust/tests/mir-opt/building/match/simple_match.rs

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

27 lines
466 B
Rust
Raw Normal View History

// skip-filecheck
2019-05-25 20:13:53 +01:00
// Test that we don't generate unnecessarily large MIR for very simple matches
// EMIT_MIR simple_match.match_bool.built.after.mir
2019-05-25 20:13:53 +01:00
fn match_bool(x: bool) -> usize {
match x {
true => 10,
_ => 20,
}
}
2024-06-27 11:24:05 +02:00
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,
}
}
2019-05-25 20:13:53 +01:00
fn main() {}