summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/const_prop/switch_int.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mir-opt/const_prop/switch_int.rs')
-rw-r--r--tests/mir-opt/const_prop/switch_int.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/mir-opt/const_prop/switch_int.rs b/tests/mir-opt/const_prop/switch_int.rs
new file mode 100644
index 000000000..d7319eca1
--- /dev/null
+++ b/tests/mir-opt/const_prop/switch_int.rs
@@ -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),
+ }
+}