PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr45085.c
blobd95ac8620ca4b0700b31281852971b5f5a75aca8
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wuninitialized" } */
3 struct S { char *s1; long s2; };
4 struct T { int t1; long t2; long t3; };
5 extern int fn2 (void);
6 extern int fn3 (struct T);
7 extern struct T fn4 ();
8 extern int fn5 (char **, long *, int);
9 extern void fn6 (void);
10 extern void fn7 (void *);
11 struct S *fn10 ();
12 static int p;
13 static void *q;
14 extern struct T r;
16 static struct T
17 fn8 (struct T x, int y)
19 struct S *u = fn10 ();
20 int v = fn5 (&u->s1, &u->s2, 0);
21 while (1)
23 if (p)
24 fn6 ();
25 if (fn3 (x))
26 return fn4 ();
27 if (y & 1)
28 return r;
29 v = fn5 (&u->s1, &u->s2, 1);
33 struct T
34 fn9 (struct T x, int y)
36 struct T t = fn8 (x, y);
37 if (fn2 ())
38 fn7 (q);
39 return t;
42 void *
43 fn1 (void)
45 return fn9;