2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 960521-1.c
blob9fc5821495a37059c21107e75b30a05b4e822165
1 #include <stdlib.h>
3 int *a, *b;
4 int n;
6 #ifdef STACK_SIZE
7 #define BLOCK_SIZE (STACK_SIZE / (sizeof (*a) + sizeof (*b)))
8 #else
9 #define BLOCK_SIZE 32768
10 #endif
11 foo ()
13 int i;
14 for (i = 0; i < n; i++)
15 a[i] = -1;
16 for (i = 0; i < BLOCK_SIZE - 1; i++)
17 b[i] = -1;
20 main ()
22 n = BLOCK_SIZE;
23 a = malloc (n * sizeof(*a));
24 b = malloc (n * sizeof(*b));
25 *b++ = 0;
26 foo ();
27 if (b[-1])
28 abort ();
29 exit (0);