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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [builtins/] [abs-1-lib.c] - Rev 688

Compare with Previous | Blame | View Log

extern void abort (void);
extern int abs_called;
extern int inside_main;
 
/* The labs call should have been optimized, but the abs call
   shouldn't have been.  */
 
int
abs (int x)
{
  if (inside_main)
    abs_called = 1;
  return (x < 0 ? -x : x);
}
 
long
labs (long x)
{
  if (inside_main)
    abort ();
  return (x < 0 ? -x : x);
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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