Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.c-torture / compile / 20020706-2.c
blobb84dda60fd31200e915e82ffdf3fa2d2e24b1b6a
1 // Contributed by Alexandre Oliva <aoliva@redhat.com>
2 // From Red Hat case 106165.
4 typedef unsigned short (FUNC_P) (void *, unsigned char *, unsigned short);
6 void crashIt(int id, FUNC_P *func, unsigned char *funcparm)
8 unsigned char buff[5], reverse[4];
9 unsigned char *bp = buff;
10 unsigned char *rp = reverse;
11 unsigned short int count = 0;
12 unsigned short cnt;
13 while (id > 0)
15 *rp++ = (unsigned char) (id & 0x7F);
16 id >>= 7;
17 count++;
19 cnt = count + 1;
20 while ((count--) > 1)
22 *bp++ = (unsigned char)(*(--rp) | 0x80);
24 *bp++ = *(--rp);
25 (void)(*func)(funcparm, buff, cnt);