diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-28 22:00:45 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-28 22:00:45 +0000 |
commit | 4070bd4355fd0e130b0ac014f25446406d7ff370 (patch) | |
tree | 451e1dd81a01cb687f9656fc6cb9a2a00cd3f030 /gcc/testsuite/gcc.dg/builtins-1.c | |
parent | 847749e5217de270f8bc495aafeb7ff261c63fec (diff) | |
download | gcc-4070bd4355fd0e130b0ac014f25446406d7ff370.tar.gz |
* builtin-types.def (BT_INT_PTR, BT_FLOAT_PTR, BT_DOUBLE_PTR,
BT_LONGDOUBLE_PTR, BT_FN_FLOAT_FLOAT_FLOATPTR,
BT_FN_DOUBLE_DOUBLE_DOUBLEPTR,
BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR,
BT_FN_FLOAT_FLOAT_INTPTR, BT_FN_DOUBLE_DOUBLE_INTPTR,
BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR,
BT_FN_FLOAT_FLOAT_FLOAT_INTPTR, BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR,
BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR,
BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR,
BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR,
BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR): New.
* builtins.def (BUILT_IN_FREXP, BUILT_IN_FREXPF, BUILT_IN_FREXPL,
BUILT_IN_MODF, BUILT_IN_MODFF, BUILT_IN_MODFL, BUILT_IN_REMQUO,
BUILT_IN_REMQUOF, BUILT_IN_REMQUOL, BUILT_IN_SINCOS,
BUILT_IN_SINCOSF, BUILT_IN_SINCOSL): New.
* tree.c: Assign new type_nodes.
* tree.h (tree_index): Add TI_FLOAT_PTR_TYPE, TI_DOUBLE_PTR_TYPE,
TI_LONG_DOUBLE_PTR_TYPE, TI_INTEGER_PTR_TYPE.
(float_ptr_type_node, double_ptr_type_node,
long_double_ptr_type_node, integer_ptr_type_node): New type_nodes.
* doc/extend.texi: Document new builtins.
testsuite:
* gcc.dg/builtins-1.c: Add new builtin cases.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70890 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtins-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/builtins-1.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtins-1.c b/gcc/testsuite/gcc.dg/builtins-1.c index 297a083771d..85636fa9e87 100644 --- a/gcc/testsuite/gcc.dg/builtins-1.c +++ b/gcc/testsuite/gcc.dg/builtins-1.c @@ -44,6 +44,13 @@ double test_##FN(double x, TYPE y) { return __builtin_##FN(x, y); } \ float test_##FN##f(float x, TYPE y) { return __builtin_##FN##f(x, y); } \ long double test_##FN##l(long double x, TYPE y) { return __builtin_##FN##l(x, y); } +/* Test FP functions taking two arguments, the second argument is a + FP pointer. */ +#define FPTEST2FPP2(FN) \ +double test_##FN(double x, double *y) { return __builtin_##FN(x, y); } \ +float test_##FN##f(float x, float *y) { return __builtin_##FN##f(x, y); } \ +long double test_##FN##l(long double x, long double *y) { return __builtin_##FN##l(x, y); } + /* Test FP functions taking one FP argument and a supplied return type. */ #define FPTEST1RET(FN, TYPE) \ @@ -63,6 +70,20 @@ double test_##FN(double x, double y, double z) { return __builtin_##FN(x, y, z); float test_##FN##f(float x, float y, float z) { return __builtin_##FN##f(x, y, z); } \ long double test_##FN##l(long double x, long double y, long double z) { return __builtin_##FN##l(x, y, z); } +/* Test FP functions taking three arguments, two FP and the third is + of a supplied type. */ +#define FPTEST3ARG3(FN, TYPE) \ +double test_##FN(double x, double y, TYPE z) { return __builtin_##FN(x, y, z); } \ +float test_##FN##f(float x, float y, TYPE z) { return __builtin_##FN##f(x, y, z); } \ +long double test_##FN##l(long double x, long double y, TYPE z) { return __builtin_##FN##l(x, y, z); } + +/* Test FP functions taking three FP arguments. The second and third + are FP pointers. The return type is void. */ +#define FPTEST3FPP23VOID(FN) \ +double test_##FN(double x, double *y, double *z) { __builtin_##FN(x, y, z); return *y * *z; } \ +float test_##FN##f(float x, float *y, float *z) { __builtin_##FN##f(x, y, z); return *y * *z; } \ +long double test_##FN##l(long double x, long double *y, long double *z) { __builtin_##FN##l(x, y, z); return *y * *z; } + /* Keep this list sorted alphabetically by function name. */ FPTEST1 (acos) FPTEST1 (acosh) @@ -90,6 +111,7 @@ FPTEST3 (fma) FPTEST2 (fmax) FPTEST2 (fmin) FPTEST2 (fmod) +FPTEST2ARG2 (frexp, int *) FPTEST1 (gamma) FPTEST0 (huge_val) FPTEST2 (hypot) @@ -109,6 +131,7 @@ FPTEST1 (log2) FPTEST1 (logb) FPTEST1RET (lrint, long) FPTEST1RET (lround, long) +FPTEST2FPP2 (modf) FPTEST1ARG (nan, char *) FPTEST1ARG (nans, char *) FPTEST1 (nearbyint) @@ -117,6 +140,7 @@ FPTEST2 (nexttoward) FPTEST2 (pow) FPTEST1 (pow10) FPTEST2 (remainder) +FPTEST3ARG3 (remquo, int *) FPTEST1 (rint) FPTEST1 (round) FPTEST2 (scalb) @@ -124,6 +148,7 @@ FPTEST2ARG2 (scalbln, int) FPTEST2ARG2 (scalbn, int) FPTEST1 (significand) FPTEST1 (sin) +FPTEST3FPP23VOID (sincos) FPTEST1 (sinh) FPTEST1 (sqrt) FPTEST1 (tan) |