summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr34225.c
blob: 659e176ad96a64d64a5effe89cf480af6e228bfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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;
}