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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20020503-1.c] - Diff between revs 149 and 154

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

Rev 149 Rev 154
/* PR 6534 */
/* PR 6534 */
/* GCSE unified the two i<0 tests, but if-conversion to ui=abs(i)
/* GCSE unified the two i<0 tests, but if-conversion to ui=abs(i)
   insertted the code at the wrong place corrupting the i<0 test.  */
   insertted the code at the wrong place corrupting the i<0 test.  */
 
 
void abort (void);
void abort (void);
static char *
static char *
inttostr (long i, char buf[128])
inttostr (long i, char buf[128])
{
{
  unsigned long ui = i;
  unsigned long ui = i;
  char *p = buf + 127;
  char *p = buf + 127;
  *p = '\0';
  *p = '\0';
  if (i < 0)
  if (i < 0)
    ui = -ui;
    ui = -ui;
  do
  do
    *--p = '0' + ui % 10;
    *--p = '0' + ui % 10;
  while ((ui /= 10) != 0);
  while ((ui /= 10) != 0);
  if (i < 0)
  if (i < 0)
    *--p = '-';
    *--p = '-';
  return p;
  return p;
}
}
 
 
int
int
main ()
main ()
{
{
  char buf[128], *p;
  char buf[128], *p;
 
 
  p = inttostr (-1, buf);
  p = inttostr (-1, buf);
  if (*p != '-')
  if (*p != '-')
    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.