]> git.lizzy.rs Git - rust.git/blobdiff - tests/mir-opt/const_prop/switch_int.rs
Move /src/test to /tests
[rust.git] / tests / mir-opt / const_prop / switch_int.rs
diff --git a/tests/mir-opt/const_prop/switch_int.rs b/tests/mir-opt/const_prop/switch_int.rs
new file mode 100644 (file)
index 0000000..d7319ec
--- /dev/null
@@ -0,0 +1,11 @@
+#[inline(never)]
+fn foo(_: i32) { }
+
+// EMIT_MIR switch_int.main.ConstProp.diff
+// EMIT_MIR switch_int.main.SimplifyConstCondition-after-const-prop.diff
+fn main() {
+    match 1 {
+        1 => foo(0),
+        _ => foo(-1),
+    }
+}