OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [20020706-2.c] - Blame information for rev 154

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// Contributed by Alexandre Oliva <aoliva@redhat.com>
2
// From Red Hat case 106165.
3
 
4
typedef unsigned short (FUNC_P) (void *, unsigned char *, unsigned short);
5
 
6
void crashIt(int id, FUNC_P *func, unsigned char *funcparm)
7
{
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)
14
    {
15
      *rp++ = (unsigned char) (id & 0x7F);
16
      id >>= 7;
17
      count++;
18
    }
19
  cnt = count + 1;
20
  while ((count--) > 1)
21
    {
22
      *bp++ = (unsigned char)(*(--rp) | 0x80);
23
    }
24
  *bp++ = *(--rp);
25
  (void)(*func)(funcparm, buff, cnt);
26
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.