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/] [20000313-1.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
unsigned int buggy (unsigned int *param)
2
{
3
  unsigned int accu, zero = 0, borrow;
4
  accu    = - *param;
5
  borrow  = - (accu > zero);
6
  *param += accu;
7
  return borrow;
8
}
9
 
10
int main (void)
11
{
12
  unsigned int param  = 1;
13
  unsigned int borrow = buggy (&param);
14
 
15
  if (param != 0)
16
    abort ();
17
  if (borrow + 1 != 0)
18
    abort ();
19
  return 0;
20
}

powered by: WebSVN 2.1.0

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