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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* PR 6534 */
2
/* GCSE unified the two i<0 tests, but if-conversion to ui=abs(i)
3
   insertted the code at the wrong place corrupting the i<0 test.  */
4
 
5
void abort (void);
6
static char *
7
inttostr (long i, char buf[128])
8
{
9
  unsigned long ui = i;
10
  char *p = buf + 127;
11
  *p = '\0';
12
  if (i < 0)
13
    ui = -ui;
14
  do
15
    *--p = '0' + ui % 10;
16
  while ((ui /= 10) != 0);
17
  if (i < 0)
18
    *--p = '-';
19
  return p;
20
}
21
 
22
int
23
main ()
24
{
25
  char buf[128], *p;
26
 
27
  p = inttostr (-1, buf);
28
  if (*p != '-')
29
    abort ();
30
  return 0;
31
}

powered by: WebSVN 2.1.0

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