summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr43513.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr43513.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr43513.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr43513.c b/gcc/testsuite/gcc.dg/pr43513.c
new file mode 100644
index 00000000000..78a037b5985
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43513.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ccp2" } */
+
+void bar (int *);
+void foo (char *, int);
+
+void
+foo3 ()
+{
+ const int kIterations = 10;
+ int results[kIterations];
+ int i;
+ bar (results);
+ for (i = 0; i < kIterations; i++)
+ foo ("%d ", results[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "alloca" 0 "ccp2"} } */
+/* { dg-final { cleanup-tree-dump "ccp2" } } */