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/] [20030120-1.c] - Diff between revs 297 and 338

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

Rev 297 Rev 338
/* On H8/300 port, NOTICE_UPDATE_CC had a bug that causes the final
/* On H8/300 port, NOTICE_UPDATE_CC had a bug that causes the final
   pass to remove test insns that should be kept.  */
   pass to remove test insns that should be kept.  */
 
 
unsigned short
unsigned short
test1 (unsigned short w)
test1 (unsigned short w)
{
{
  if ((w & 0xff00) == 0)
  if ((w & 0xff00) == 0)
    {
    {
      if (w == 0)
      if (w == 0)
        w = 2;
        w = 2;
    }
    }
  return w;
  return w;
}
}
 
 
unsigned long
unsigned long
test2 (unsigned long w)
test2 (unsigned long w)
{
{
  if ((w & 0xffff0000) == 0)
  if ((w & 0xffff0000) == 0)
    {
    {
      if (w == 0)
      if (w == 0)
        w = 2;
        w = 2;
    }
    }
  return w;
  return w;
}
}
 
 
int
int
test3 (unsigned short a)
test3 (unsigned short a)
{
{
  if (a & 1)
  if (a & 1)
    return 1;
    return 1;
  else if (a)
  else if (a)
    return 1;
    return 1;
  else
  else
    return 0;
    return 0;
}
}
 
 
int
int
main ()
main ()
{
{
  if (test1 (1) != 1)
  if (test1 (1) != 1)
    abort ();
    abort ();
 
 
  if (test2 (1) != 1)
  if (test2 (1) != 1)
    abort ();
    abort ();
 
 
  if (test3 (2) != 1)
  if (test3 (2) != 1)
    abort ();
    abort ();
 
 
  exit (0);
  exit (0);
}
}
 
 

powered by: WebSVN 2.1.0

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