summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c
new file mode 100644
index 00000000000..7c83007e7f1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(int a, int b, int c)
+{
+ if (a == 0 && b > c)
+ return 0;
+ return a;
+}
+
+int g(int a, int b, int c)
+{
+ if (a == 42 && b > c)
+ return 42;
+ return a;
+}
+
+int h(int a, int b, int c, int d)
+{
+ if (a == d && b > c)
+ return d;
+ return a;
+}
+/* { dg-final { scan-tree-dump-times "if" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */