1extern int inside_main;
2extern 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
9typedef __INTMAX_TYPE__ intmax_t;
10
11__attribute__ ((__noinline__))
12int
13abs (int x)
14{
15  ABORT_INSIDE_MAIN;
16  return x < 0 ? -x : x;
17}
18
19__attribute__ ((__noinline__))
20long
21labs (long x)
22{
23  ABORT_INSIDE_MAIN;
24  return x < 0 ? -x : x;
25}
26
27__attribute__ ((__noinline__))
28long long
29llabs (long long x)
30{
31  ABORT_INSIDE_MAIN;
32  return x < 0 ? -x : x;
33}
34
35__attribute__ ((__noinline__))
36intmax_t
37imaxabs (intmax_t x)
38{
39  ABORT_INSIDE_MAIN;
40  return x < 0 ? -x : x;
41}
42