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] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
extern void abort (void);
2
extern int abs_called;
3
extern int inside_main;
4
 
5
/* The labs call should have been optimized, but the abs call
6
   shouldn't have been.  */
7
 
8
int
9
abs (int x)
10
{
11
  if (inside_main)
12
    abs_called = 1;
13
  return (x < 0 ? -x : x);
14
}
15
 
16
long
17
labs (long x)
18
{
19
  if (inside_main)
20
    abort ();
21
  return (x < 0 ? -x : x);
22
}

powered by: WebSVN 2.1.0

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