summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/equal_true.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mir-opt/equal_true.rs')
-rw-r--r--tests/mir-opt/equal_true.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/mir-opt/equal_true.rs b/tests/mir-opt/equal_true.rs
new file mode 100644
index 000000000..717d10c6d
--- /dev/null
+++ b/tests/mir-opt/equal_true.rs
@@ -0,0 +1,11 @@
+// unit-test InstCombine
+
+// EMIT_MIR equal_true.opt.InstCombine.diff
+
+fn opt(x: bool) -> i32 {
+ if x == true { 0 } else { 1 }
+}
+
+fn main() {
+ opt(true);
+}