FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / loop-2e.c
blob71c7a4d1d87b57e78c2651b9c224e4bbe0729e7d
1 void f (int *p, int **q)
3 int i;
4 for (i = 0; i < 40; i++)
6 *q++ = &p[i];
10 int main ()
12 void *p;
13 int *q[40];
14 __SIZE_TYPE__ start;
16 /* Find the signed middle of the address space. */
17 if (sizeof(start) == sizeof(int))
18 start = (__SIZE_TYPE__) __INT_MAX__;
19 else if (sizeof(start) == sizeof(long))
20 start = (__SIZE_TYPE__) __LONG_MAX__;
21 else if (sizeof(start) == sizeof(long long))
22 start = (__SIZE_TYPE__) __LONG_LONG_MAX__;
23 else
24 return 0;
26 /* Arbitrarily align the pointer. */
27 start &= -32;
29 /* Pretend that's good enough to start address arithmetic. */
30 p = (void *)start;
32 /* Verify that GIV replacement computes the correct results. */
33 q[39] = 0;
34 f (p, q);
35 if (q[39] != (int *)p + 39)
36 abort ();
38 return 0;