rust/tests/ui/mir/mir_codegen_switchint.rs
2023-01-11 09:32:08 +00:00

13 lines
146 B
Rust

// run-pass
pub fn foo(x: i8) -> i32 {
match x {
1 => 0,
_ => 1,
}
}
fn main() {
assert_eq!(foo(0), 1);
assert_eq!(foo(1), 0);
}