PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / pr51990.c
blob4f7e0e4fd370e0021c11d1760cfd4a7ee89cd658
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3 /* { dg-require-effective-target alloca } */
5 int
6 zzz (char *s1, char *s2, int len, int *q)
8 int z = 5;
9 unsigned int i, b;
10 struct s { char a[z]; };
11 struct s x;
13 extern int foo (int, ...) __attribute__((pure));
15 for (i = 0; i < len; i++)
16 s1[i] = s2[i];
18 b = z & 0x3;
20 len += (b == 0 ? 0 : 1) + z;
22 *q = len;
23 return foo (z, x, x);