summaryrefslogtreecommitdiffstats
path: root/tests/ui/mir/mir_codegen_switchint.rs
blob: c092a6c31b2d13ba7448e63c4f4fb8321e8f115e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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);
}