PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr22061-1.c
blobffd6ccc7b46b26231baa7cc4c025dddf721bfac3
1 /* { dg-require-effective-target alloca } */
2 int N = 1;
3 void foo() {} /* Necessary to trigger the original ICE. */
4 void bar (char a[2][N]) { a[1][0] = N; }
5 int
6 main (void)
8 void *x;
10 N = 4;
11 x = alloca (2 * N);
12 memset (x, 0, 2 * N);
13 bar (x);
14 if (N[(char *) x] != N)
15 abort ();
16 exit (0);