summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr34225.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.dg/pr34225.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr34225.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr34225.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr34225.c b/gcc/testsuite/gcc.dg/pr34225.c
new file mode 100644
index 000000000..659e176ad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr34225.c
@@ -0,0 +1,61 @@
+/* PR target/34225 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -fstack-protector" } */
+/* { dg-require-effective-target fstack_protector } */
+
+typedef __SIZE_TYPE__ size_t;
+extern int sscanf (const char *, const char *, ...);
+struct C
+{
+ char c[240];
+};
+struct O
+{
+ char **o;
+};
+struct P
+{
+ int p1;
+ char p2[256];
+ char p3[256];
+ char p4[256];
+};
+
+extern void *s;
+extern int f1 (char *, struct C *);
+extern void f2 (void *, const char *);
+extern void f3 (char *, const char *);
+extern int f4 (int, double *, int);
+
+int
+foo (char *a[], struct O *b, int c, int d, struct P *e, int f, int *h,
+ char *l)
+{
+ int i, g = 7, m = 0, n;
+ struct C j[150];
+ double *k[150];
+ char o[100];
+
+ if (f1 (o, &j[g]) < 0)
+ g++;
+
+ while (!m)
+ {
+ f2 (s, "xxx");
+ for (i = 0; i < f; i++)
+ if ((!b->o && __builtin_strncmp (l, "abcde", 5) == 0)
+ || (b->o && !b->o[c]))
+ {
+ *e[d].p4 = *e[d].p3 = *e[d].p2 = 0;
+ sscanf (l, "%s %s %[^\n]", e[d].p3, e[d].p2, e[d].p4);
+ }
+ for (n = 0; n < d; n++)
+ for (i = 0; i < g; i++)
+ {
+ f3 (a[i + 1], "foo");
+ if (f4 (h[i], k[i], e[n].p1) < 0)
+ f3 (a[i + 1], "bar");
+ }
+ }
+ return 0;
+}