CASE_FLT_FN (BUILT_IN_ASINH):
CASE_FLT_FN (BUILT_IN_ATAN):
CASE_FLT_FN (BUILT_IN_ATANH):
+ CASE_FLT_FN (BUILT_IN_CASIN):
+ CASE_FLT_FN (BUILT_IN_CASINH):
+ CASE_FLT_FN (BUILT_IN_CATAN):
+ CASE_FLT_FN (BUILT_IN_CATANH):
CASE_FLT_FN (BUILT_IN_CBRT):
+ CASE_FLT_FN (BUILT_IN_CPROJ):
+ CASE_FLT_FN (BUILT_IN_CSIN):
+ CASE_FLT_FN (BUILT_IN_CSINH):
+ CASE_FLT_FN (BUILT_IN_CTAN):
+ CASE_FLT_FN (BUILT_IN_CTANH):
CASE_FLT_FN (BUILT_IN_ERF):
CASE_FLT_FN (BUILT_IN_LLROUND):
CASE_FLT_FN (BUILT_IN_LROUND):
extern double hypot (double, double);
extern double pure (double) __attribute__ ((__pure__));
extern double carg (__complex__ double);
+extern __complex__ double ccos (__complex__ double);
+extern __complex__ double ctan (__complex__ double);
extern float cosf (float);
extern float sinf (float);
extern float tanf (float);
extern float hypotf (float, float);
extern float puref (float) __attribute__ ((__pure__));
extern float cargf (__complex__ float);
+extern __complex__ float ccosf (__complex__ float);
+extern __complex__ float ctanf (__complex__ float);
extern long double cosl (long double);
extern long double sinl (long double);
extern long double tanl (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 __complex__ long double ccosl (__complex__ long double);
+extern __complex__ long double ctanl (__complex__ long double);
extern void link_error(void);
link_error ();
}
-void test3(__complex__ double z)
+void test3(__complex__ double x, __complex__ double y, int i)
{
- if (carg(z) != atan2(__imag__ z, __real__ z))
+ if (carg(x) != atan2(__imag__ x, __real__ x))
link_error ();
+
+ if (ccos(x) != ccos(-x))
+ link_error();
+
+ if (ccos(ctan(x)) != ccos(ctan(-x)))
+ link_error();
+
+ if (ctan(x-y) != -ctan(y-x))
+ link_error();
+
+ if (ccos(x/y) != ccos(-x/y))
+ link_error();
+
+ if (ccos(x/y) != ccos(x/-y))
+ link_error();
+
+ if (ccos(x/ctan(y)) != ccos(-x/ctan(-y)))
+ link_error();
+
+ if (ccos(x*y) != ccos(-x*y))
+ link_error();
+
+ if (ccos(x*y) != ccos(x*-y))
+ link_error();
+
+ if (ccos(ctan(x)*y) != ccos(ctan(-x)*-y))
+ link_error();
+
+ if (ccos(ctan(x/y)) != ccos(-ctan(x/-y)))
+ link_error();
+
+ if (ccos(i ? x : y) != ccos(i ? -x : y))
+ link_error();
+
+ if (ccos(i ? x : y) != ccos(i ? x : -y))
+ link_error();
+
+ if (ccos(i ? x : ctan(y/x)) != ccos(i ? -x : -ctan(-y/x)))
+ link_error();
}
void test1f(float x)
link_error ();
}
-void test3f(__complex__ float z)
+void test3f(__complex__ float x, __complex__ float y, int i)
{
- if (cargf(z) != atan2f(__imag__ z, __real__ z))
+ if (cargf(x) != atan2f(__imag__ x, __real__ x))
link_error ();
+
+ if (ccosf(x) != ccosf(-x))
+ link_error();
+
+ if (ccosf(ctanf(x)) != ccosf(ctanf(-x)))
+ link_error();
+
+ if (ctanf(x-y) != -ctanf(y-x))
+ link_error();
+
+ if (ccosf(x/y) != ccosf(-x/y))
+ link_error();
+
+ if (ccosf(x/y) != ccosf(x/-y))
+ link_error();
+
+ if (ccosf(x/ctanf(y)) != ccosf(-x/ctanf(-y)))
+ link_error();
+
+ if (ccosf(x*y) != ccosf(-x*y))
+ link_error();
+
+ if (ccosf(x*y) != ccosf(x*-y))
+ link_error();
+
+ if (ccosf(ctanf(x)*y) != ccosf(ctanf(-x)*-y))
+ link_error();
+
+ if (ccosf(ctanf(x/y)) != ccosf(-ctanf(x/-y)))
+ link_error();
+
+ if (ccosf(i ? x : y) != ccosf(i ? -x : y))
+ link_error();
+
+ if (ccosf(i ? x : y) != ccosf(i ? x : -y))
+ link_error();
+
+ if (ccosf(i ? x : ctanf(y/x)) != ccosf(i ? -x : -ctanf(-y/x)))
+ link_error();
}
void test1l(long double x)
link_error ();
}
-void test3l(__complex__ long double z)
+void test3l(__complex__ long double x, __complex__ long double y, int i)
{
- if (cargl(z) != atan2l(__imag__ z, __real__ z))
+ if (cargl(x) != atan2l(__imag__ x, __real__ x))
link_error ();
+
+ if (ccosl(x) != ccosl(-x))
+ link_error();
+
+ if (ccosl(ctanl(x)) != ccosl(ctanl(-x)))
+ link_error();
+
+ if (ctanl(x-y) != -ctanl(y-x))
+ link_error();
+
+ if (ccosl(x/y) != ccosl(-x/y))
+ link_error();
+
+ if (ccosl(x/y) != ccosl(x/-y))
+ link_error();
+
+ if (ccosl(x/ctanl(y)) != ccosl(-x/ctanl(-y)))
+ link_error();
+
+ if (ccosl(x*y) != ccosl(-x*y))
+ link_error();
+
+ if (ccosl(x*y) != ccosl(x*-y))
+ link_error();
+
+ if (ccosl(ctanl(x)*y) != ccosl(ctanl(-x)*-y))
+ link_error();
+
+ if (ccosl(ctanl(x/y)) != ccosl(-ctanl(x/-y)))
+ link_error();
+
+ if (ccosl(i ? x : y) != ccosl(i ? -x : y))
+ link_error();
+
+ if (ccosl(i ? x : y) != ccosl(i ? x : -y))
+ link_error();
+
+ if (ccosl(i ? x : ctanl(y/x)) != ccosl(i ? -x : -ctanl(-y/x)))
+ link_error();
}
int main()
link_error(__LINE__); \
} while (0)
+/* Test that FUNC(-ARG) == FUNC(ARG), where ARG has a complex type. */
+#define TESTIT_EVEN_C(FUNC) do { \
+ if (__builtin_##FUNC##f(-cxf) != __builtin_##FUNC##f(cxf)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(-cx) != __builtin_##FUNC(cx)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(-cxl) != __builtin_##FUNC##l(cxl)) \
+ link_error(__LINE__); \
+ } while (0)
+
/* Test that FUNC(-VAR) == FUNC(VAR), where VAR has an int type. */
#define TESTIT_EVEN_I(FUNC,VAR) do { \
if (__builtin_##FUNC(-VAR) != __builtin_##FUNC(VAR)) \
link_error(__LINE__); \
} while (0)
+/* Test that -FUNC(ARG) == FUNC(-ARG), where ARG has a complex type. */
+#define TESTIT_ODD_C(FUNC) do { \
+ if (-__builtin_##FUNC##f(-cxf) != __builtin_##FUNC##f(cxf)) \
+ link_error(__LINE__); \
+ if (-__builtin_##FUNC(-cx) != __builtin_##FUNC(cx)) \
+ link_error(__LINE__); \
+ if (-__builtin_##FUNC##l(-cxl) != __builtin_##FUNC##l(cxl)) \
+ link_error(__LINE__); \
+ } while (0)
+
void foo (float xf, double x, long double xl,
+ __complex__ float cxf, __complex__ double cx, __complex__ long double cxl,
int i, long l, long long ll, __INTMAX_TYPE__ im)
{
TESTIT_EVEN(cos);
TESTIT_EVEN(cosh);
TESTIT_EVEN(fabs);
+ TESTIT_EVEN_C(ccos);
+ TESTIT_EVEN_C(ccosh);
+ TESTIT_EVEN_C(cabs);
+
TESTIT_EVEN_I(abs, i);
TESTIT_EVEN_I(imaxabs, im);
TESTIT_EVEN_I(labs, l);
TESTIT_ODD(tan);
TESTIT_ODD(tanh);
TESTIT_ODD(trunc);
+
+ TESTIT_ODD_C(casin);
+ TESTIT_ODD_C(casinh);
+ TESTIT_ODD_C(catan);
+ TESTIT_ODD_C(catanh);
+ TESTIT_ODD_C(cproj);
+ TESTIT_ODD_C(csin);
+ TESTIT_ODD_C(csinh);
+ TESTIT_ODD_C(ctan);
+ TESTIT_ODD_C(ctanh);
}
int main()
{
- foo (1,1,1,1,1,1,1);
+ foo (1,1,1,1,1,1,1,1,1,1);
return 0;
}