Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/builtins/abs-1-lib.c

raw
1 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 }