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/] [lib/] [abs.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
extern int inside_main;
2
extern void abort (void);
3
#ifdef __OPTIMIZE__
4
#define ABORT_INSIDE_MAIN do { if (inside_main) abort (); } while (0)
5
#else
6
#define ABORT_INSIDE_MAIN do { } while (0)
7
#endif
8
 
9
typedef __INTMAX_TYPE__ intmax_t;
10
 
11
__attribute__ ((__noinline__))
12
int
13
abs (int x)
14
{
15
  ABORT_INSIDE_MAIN;
16
  return x < 0 ? -x : x;
17
}
18
 
19
__attribute__ ((__noinline__))
20
long
21
labs (long x)
22
{
23
  ABORT_INSIDE_MAIN;
24
  return x < 0 ? -x : x;
25
}
26
 
27
__attribute__ ((__noinline__))
28
long long
29
llabs (long long x)
30
{
31
  ABORT_INSIDE_MAIN;
32
  return x < 0 ? -x : x;
33
}
34
 
35
__attribute__ ((__noinline__))
36
intmax_t
37
imaxabs (intmax_t x)
38
{
39
  ABORT_INSIDE_MAIN;
40
  return x < 0 ? -x : x;
41
}

powered by: WebSVN 2.1.0

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