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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20050124-1.c] - Diff between revs 297 and 338

Only display areas with differences | Details | Blame | View Log

Rev 297 Rev 338
/* PR rtl-optimization/19579 */
/* PR rtl-optimization/19579 */
 
 
extern void abort (void);
extern void abort (void);
 
 
int
int
foo (int i, int j)
foo (int i, int j)
{
{
  int k = i + 1;
  int k = i + 1;
 
 
  if (j)
  if (j)
    {
    {
      if (k > 0)
      if (k > 0)
        k++;
        k++;
      else if (k < 0)
      else if (k < 0)
        k--;
        k--;
    }
    }
 
 
  return k;
  return k;
}
}
 
 
int
int
main (void)
main (void)
{
{
  if (foo (-2, 0) != -1)
  if (foo (-2, 0) != -1)
    abort ();
    abort ();
  if (foo (-1, 0) != 0)
  if (foo (-1, 0) != 0)
    abort ();
    abort ();
  if (foo (0, 0) != 1)
  if (foo (0, 0) != 1)
    abort ();
    abort ();
  if (foo (1, 0) != 2)
  if (foo (1, 0) != 2)
    abort ();
    abort ();
  if (foo (-2, 1) != -2)
  if (foo (-2, 1) != -2)
    abort ();
    abort ();
  if (foo (-1, 1) != 0)
  if (foo (-1, 1) != 0)
    abort ();
    abort ();
  if (foo (0, 1) != 2)
  if (foo (0, 1) != 2)
    abort ();
    abort ();
  if (foo (1, 1) != 3)
  if (foo (1, 1) != 3)
    abort ();
    abort ();
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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