Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.c-torture / execute / 20120808-1.c
1 extern void exit (int);
2 extern void abort (void);
3
4 volatile int i;
5 unsigned char *volatile cp;
6 unsigned char d[32] = { 0 };
7
8 int
9 main (void)
10 {
11   unsigned char c[32] = { 0 };
12   unsigned char *p = d + i;
13   int j;
14   for (j = 0; j < 30; j++)
15     {
16       int x = 0xff;
17       int y = *++p;
18       switch (j)
19         {
20         case 1: x ^= 2; break;
21         case 2: x ^= 4; break;
22         case 25: x ^= 1; break;
23         default: break;
24         }
25       c[j] = y | x;
26       cp = p;
27     }
28   if (c[0] != 0xff
29       || c[1] != 0xfd
30       || c[2] != 0xfb
31       || c[3] != 0xff
32       || c[4] != 0xff
33       || c[25] != 0xfe
34       || cp != d + 30)
35     abort ();
36   exit (0);
37 }