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

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

Line No. Rev Author Line
1 149 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
int
12
abs (int x)
13
{
14
  ABORT_INSIDE_MAIN;
15
  return x < 0 ? -x : x;
16
}
17
 
18
long
19
labs (long x)
20
{
21
  ABORT_INSIDE_MAIN;
22
  return x < 0 ? -x : x;
23
}
24
 
25
long long
26
llabs (long long x)
27
{
28
  ABORT_INSIDE_MAIN;
29
  return x < 0 ? -x : x;
30
}
31
 
32
intmax_t
33
imaxabs (intmax_t x)
34
{
35
  ABORT_INSIDE_MAIN;
36
  return x < 0 ? -x : x;
37
}

powered by: WebSVN 2.1.0

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