summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/bool-7.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/bool-7.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/bool-7.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bool-7.c b/gcc/testsuite/gcc.dg/tree-ssa/bool-7.c
new file mode 100644
index 000000000..b79871064
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/bool-7.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ int y;
+ if (x != 1)
+ y = 0;
+ else
+ y = 1;
+ return y;
+}
+
+/* There should be no != 1. Fold changes x != 1 to ! x. */
+/* { dg-final { scan-tree-dump-times "!= 1" 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */