2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / builtins / abs-1.c
blob1584515af78e18638ddf47ea66584b9e06e9b7a5
1 /* Test for -fno-builtin-FUNCTION. */
2 /* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
3 /* GCC normally handles abs and labs as built-in functions even without
4 optimization. So test that with -fno-builtin-abs, labs is so handled
5 but abs isn't. */
7 int abs_called = 0;
9 extern int abs (int);
10 extern long labs (long);
11 extern void abort (void);
12 extern void exit (int);
14 void
15 main_test (void)
17 if (labs (0) != 0)
18 abort ();
19 if (abs (0) != 0)
20 abort ();
21 if (!abs_called)
22 abort ();