summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mir/mir_codegen_switchint.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/mir/mir_codegen_switchint.rs')
-rw-r--r--src/test/ui/mir/mir_codegen_switchint.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/mir/mir_codegen_switchint.rs b/src/test/ui/mir/mir_codegen_switchint.rs
new file mode 100644
index 000000000..c092a6c31
--- /dev/null
+++ b/src/test/ui/mir/mir_codegen_switchint.rs
@@ -0,0 +1,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);
+}