aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/builtins-20.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2007-01-25 03:57:30 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2007-01-25 03:57:30 +0000
commit527cab2096ca51991db9dd06cccf0ee2bcb16b96 (patch)
treee71f14cf38a4ea58b59e83a908432bc1c7fe652e /gcc/testsuite/gcc.dg/builtins-20.c
parent9ea6c4a4b7e6622ab4bf6cd706476dced66f929f (diff)
downloadgcc-527cab2096ca51991db9dd06cccf0ee2bcb16b96.zip
gcc-527cab2096ca51991db9dd06cccf0ee2bcb16b96.tar.gz
gcc-527cab2096ca51991db9dd06cccf0ee2bcb16b96.tar.bz2
builtins.c (fold_builtin_carg): New.
* builtins.c (fold_builtin_carg): New. (fold_builtin_1): Use it. testsuite: * gcc.dg/builtins-20.c: Test builtin carg. From-SVN: r121159
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtins-20.c')
-rw-r--r--gcc/testsuite/gcc.dg/builtins-20.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtins-20.c b/gcc/testsuite/gcc.dg/builtins-20.c
index 1211cf0b..be3c81d 100644
--- a/gcc/testsuite/gcc.dg/builtins-20.c
+++ b/gcc/testsuite/gcc.dg/builtins-20.c
@@ -16,29 +16,35 @@ extern double cos (double);
extern double sin (double);
extern double tan (double);
extern double fabs (double);
+extern double atan2 (double, double);
extern double copysign (double, double);
extern double fmin (double, double);
extern double fmax (double, double);
extern double hypot (double, double);
extern double pure (double) __attribute__ ((__pure__));
+extern double carg (__complex__ double);
extern float cosf (float);
extern float sinf (float);
extern float tanf (float);
extern float fabsf (float);
+extern float atan2f (float, float);
extern float copysignf (float, float);
extern float fminf (float, float);
extern float fmaxf (float, float);
extern float hypotf (float, float);
extern float puref (float) __attribute__ ((__pure__));
+extern float cargf (__complex__ float);
extern long double cosl (long double);
extern long double sinl (long double);
extern long double tanl (long double);
extern long double fabsl (long double);
+extern long double atan2l (long double, long double);
extern long double copysignl (long double, long double);
extern long double fminl (long double, long double);
extern long double fmaxl (long double, long double);
extern long double hypotl (long double, long double);
extern long double purel (long double) __attribute__ ((__pure__));
+extern long double cargl (__complex__ long double);
extern void link_error(void);
@@ -187,6 +193,12 @@ void test2(double x, double y)
link_error ();
}
+void test3(__complex__ double z)
+{
+ if (carg(z) != atan2(__imag__ z, __real__ z))
+ link_error ();
+}
+
void test1f(float x)
{
if (cosf(x) != cosf(-x))
@@ -334,6 +346,11 @@ void test2f(float x, float y)
link_error ();
}
+void test3f(__complex__ float z)
+{
+ if (cargf(z) != atan2f(__imag__ z, __real__ z))
+ link_error ();
+}
void test1l(long double x)
{
@@ -482,6 +499,12 @@ void test2l(long double x, long double y)
link_error ();
}
+void test3l(__complex__ long double z)
+{
+ if (cargl(z) != atan2l(__imag__ z, __real__ z))
+ link_error ();
+}
+
int main()
{
test1 (1.0);