aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/20050330-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/20050330-2.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050330-2.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050330-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050330-2.c
new file mode 100644
index 000000000..f2562a8cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050330-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-O2 -fprofile-generate" } */
+
+struct S
+{
+ int a;
+ void **b;
+};
+
+void
+foo (struct S *x, int y)
+{
+ if (!x)
+ return;
+ if (y >= x->a)
+ return;
+ x->a--;
+ for (; y < x->a; y++)
+ x->b[y] = x->b[y + 1];
+ x->b[x->a] = (void *) 0;
+}