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/] [execute/] [20000801-1.c] - Blame information for rev 856

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

Line No. Rev Author Line
1 149 jeremybenn
extern void abort(void);
2
extern void exit(int);
3
 
4
void
5
foo (char *bp, unsigned n)
6
{
7
  register char c;
8
  register char *ep = bp + n;
9
  register char *sp;
10
 
11
  while (bp < ep)
12
    {
13
      sp = bp + 3;
14
      c = *sp;
15
      *sp = *bp;
16
      *bp++ = c;
17
      sp = bp + 1;
18
      c = *sp;
19
      *sp = *bp;
20
      *bp++ = c;
21
      bp += 2;
22
    }
23
}
24
 
25
int main(void)
26
{
27
  int one = 1;
28
 
29
  if (sizeof(int) != 4 * sizeof(char))
30
    exit(0);
31
 
32
  foo((char *)&one, sizeof(one));
33
  foo((char *)&one, sizeof(one));
34
 
35
  if (one != 1)
36
    abort();
37
 
38
  exit(0);
39
}

powered by: WebSVN 2.1.0

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