summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c b/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c
new file mode 100644
index 000000000..474633eab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ch-details" } */
+
+extern int foo (int);
+
+void bla (void)
+{
+ int i, n = foo (0);
+
+ for (i = 0; i < n; i++)
+ foo (i);
+}
+
+/* There should be a header duplicated. */
+/* { dg-final { scan-tree-dump-times "Duplicating header" 1 "ch"} } */
+/* { dg-final { cleanup-tree-dump "ch" } } */