summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c b/gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c
new file mode 100644
index 00000000000..4d22a42814a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dce1" } */
+void
+cleanup (int a, int b)
+{
+ if (a)
+ if (b)
+ a = 1;
+ else
+ b = 1;
+ else if (a)
+ a = 1;
+ else
+ b = 1;
+ return;
+}
+/* Dce should get rid of the initializers and cfgcleanup should elliminate ifs */
+/* { dg-final { scan-tree-dump-times "if " 0 "dce1"} } */