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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20021024-1.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* Origin: PR target/6981 from Mattias Engdegaard <mattias@virtutech.se>.  */
2
 
3
void exit (int);
4
void abort (void);
5
 
6
unsigned long long *cp, m;
7
 
8
void foo (void)
9
{
10
}
11
 
12
void bar (unsigned rop, unsigned long long *r)
13
{
14
  unsigned rs1, rs2, rd;
15
 
16
top:
17
  rs2 = (rop >> 23) & 0x1ff;
18
  rs1 = (rop >> 9) & 0x1ff;
19
  rd = rop & 0x1ff;
20
 
21
  *cp = 1;
22
  m = r[rs1] + r[rs2];
23
  *cp = 2;
24
  foo();
25
  if (!rd)
26
    goto top;
27
  r[rd] = 1;
28
}
29
 
30
int main(void)
31
{
32
  static unsigned long long r[64];
33
  unsigned long long cr;
34
  cp = &cr;
35
 
36
  r[4] = 47;
37
  r[8] = 11;
38
  bar((8 << 23) | (4 << 9) | 15, r);
39
 
40
  if (m != 47 + 11)
41
    abort ();
42
  exit (0);
43
}

powered by: WebSVN 2.1.0

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