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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20080122-1.c] - Blame information for rev 301

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

Line No. Rev Author Line
1 297 jeremybenn
/* PR rtl-optimization/34628 */
2
/* Origin: Martin Michlmayr <tbm@cyrius.com> */
3
 
4
typedef unsigned short u16;
5
typedef unsigned char u8;
6
 
7
static void
8
do_segfault(u8 in_buf[], const u8 out_buf[], const int len)
9
{
10
  int i;
11
 
12
  for (i = 0; i < len; i++) {
13
    asm("");
14
 
15
    in_buf[2*i] = (   out_buf[2*i] | out_buf[(2*i)+1]<<8  ) & 0xFF;
16
 
17
    asm("");
18
 
19
    in_buf[(2*i)+1] =  ( out_buf[2*i] | out_buf[(2*i)+1]<<8 ) >> 8;
20
 
21
    asm("");
22
  }
23
}
24
 
25
int main(int argc, char *argv[])
26
{
27
  u8 outbuf[32] = "buffer     ";
28
  u8 inbuf[32] = "\f";
29
 
30
  asm("");
31
  do_segfault(inbuf, outbuf, 12);
32
  asm("");
33
 
34
  return 0;
35
}

powered by: WebSVN 2.1.0

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