2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / builtins / abs-1-lib.c
blob9891e10c03967073d79b97361f68e6794f987177
1 extern int abs_called;
2 extern int inside_main;
4 /* The labs call should have been optimized, but the abs call
5 shouldn't have been. */
7 int
8 abs (int x)
10 if (inside_main)
11 abs_called = 1;
12 return (x < 0 ? -x : x);
15 long
16 labs (long x)
18 if (inside_main)
19 abort ();
20 return (x < 0 ? -x : x);