diff options
author | Roger Sayle <roger@eyesopen.com> | 2003-06-03 11:27:23 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2003-06-03 11:27:23 +0000 |
commit | 075ec276a051c77c1542992980d651f832e7140a (patch) | |
tree | 0ac72a6f0481c8c341e932108b5ac14e70debfbf /gcc/testsuite/gcc.dg/builtins-16.c | |
parent | ded9bf77e35ce9a22468a1f56595df0741e2f22a (diff) | |
download | gcc-075ec276a051c77c1542992980d651f832e7140a.zip gcc-075ec276a051c77c1542992980d651f832e7140a.tar.gz gcc-075ec276a051c77c1542992980d651f832e7140a.tar.bz2 |
builtins.def (BUILT_IN_CABS, [...]): New builtins representing ISO C99's cabs, cabsf and cabsl.
* builtins.def (BUILT_IN_CABS, BUILT_IN_CABSF, BUILT_IN_CABSL):
New builtins representing ISO C99's cabs, cabsf and cabsl.
* builtins.c (expand_builtin_fabs): New function.
(expand_builtin_cabs): New function.
(expand_builtin): Expand BUILT_IN_FABS{,F,L} and BUILT_IN_CABS{,F,L}
using expand_builtin_fabs and expand_builtin_cabs respectively.
* doc/extend.texi: Document new cabs, cabsf and cabsl builtins.
* gcc.dg/builtins-16.c: New test case.
From-SVN: r67368
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtins-16.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/builtins-16.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtins-16.c b/gcc/testsuite/gcc.dg/builtins-16.c new file mode 100644 index 0000000..e7ffe93 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtins-16.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2003 Free Software Foundation. + + Verify that all the __builtin_cabs? functions are recognized + by the compiler. Complex numbers are not supported with the + gcc.dg default "-pedantic-errors" option, so the dg-options + overrides this. + + Written by Roger Sayle, 1st June 2003. */ + +/* { dg-do compile } */ +/* { dg-options "-O -ansi" } */ +/* { dg-final { scan-assembler-not "__builtin_" } } */ + +double test(__complex__ double x) +{ + return __builtin_cabs (x); +} + +float testf(__complex__ float x) +{ + return __builtin_cabsf (x); +} + +long double testl(__complex__ long double x) +{ + return __builtin_cabsl (x); +} + |