aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/test-tgmath.c16
-rw-r--r--math/tgmath.h20
2 files changed, 24 insertions, 12 deletions
diff --git a/math/test-tgmath.c b/math/test-tgmath.c
index ad63f71737..b6004e573a 100644
--- a/math/test-tgmath.c
+++ b/math/test-tgmath.c
@@ -40,7 +40,8 @@ int count_double;
int count_float;
int count_ldouble;
-#define NCALLS 115
+#define NCALLS 115
+#define NCALLS_INT 4
int
main (void)
@@ -59,13 +60,13 @@ main (void)
puts ("long double function called for double test");
result = 1;
}
- if (count_double < NCALLS)
+ if (count_double < NCALLS + NCALLS_INT)
{
printf ("double functions not called often enough (%d)\n",
count_double);
result = 1;
}
- else if (count_double > NCALLS)
+ else if (count_double > NCALLS + NCALLS_INT)
{
printf ("double functions called too often (%d)\n",
count_double);
@@ -131,6 +132,7 @@ main (void)
#define F(name) name
#define TYPE double
+#define TEST_INT 1
#define x dx
#define count count_double
#include "test-tgmath.c"
@@ -217,6 +219,13 @@ F(compile_test) (void)
b = fmax (fmax (a, x), fmax (c, b));
a = fmin (fmin (x, a), fmin (c, b));
b = fma (sin (a), sin (x), sin (c));
+
+#ifdef TEST_INT
+ a = atan2 (i, b);
+ b = remquo (i, a, &i);
+ c = fma (i, b, i);
+ a = pow (i, c);
+#endif
}
#undef x
@@ -663,4 +672,5 @@ TYPE
#undef F
#undef TYPE
#undef count
+#undef TEST_INT
#endif
diff --git a/math/tgmath.h b/math/tgmath.h
index 0c02aaa6e7..1c085654c3 100644
--- a/math/tgmath.h
+++ b/math/tgmath.h
@@ -93,8 +93,8 @@
__tgmres = __tgml(Fct) (Val1, Val2); \
else if (sizeof (Val1) == sizeof (double) \
|| sizeof (Val2) == sizeof (double) \
- || __builtin_classify_type ((Val1) \
- + (Val2)) != 8) \
+ || __builtin_classify_type (Val1) != 8 \
+ || __builtin_classify_type (Val2) != 8) \
__tgmres = Fct (Val1, Val2); \
else \
__tgmres = Fct##f (Val1, Val2); \
@@ -108,8 +108,8 @@
__tgmres = __tgml(Fct) (Val1, Val2, Val3); \
else if (sizeof (Val1) == sizeof (double) \
|| sizeof (Val2) == sizeof (double) \
- || __builtin_classify_type ((Val1) \
- + (Val2)) != 8) \
+ || __builtin_classify_type (Val1) != 8 \
+ || __builtin_classify_type (Val2) != 8) \
__tgmres = Fct (Val1, Val2, Val3); \
else \
__tgmres = Fct##f (Val1, Val2, Val3); \
@@ -126,8 +126,9 @@
else if (sizeof (Val1) == sizeof (double) \
|| sizeof (Val2) == sizeof (double) \
|| sizeof (Val3) == sizeof (double) \
- || __builtin_classify_type ((Val1) + (Val2) \
- + (Val3)) != 8) \
+ || __builtin_classify_type (Val1) != 8 \
+ || __builtin_classify_type (Val2) != 8 \
+ || __builtin_classify_type (Val3) != 8) \
__tgmres = Fct (Val1, Val2, Val3); \
else \
__tgmres = Fct##f (Val1, Val2, Val3); \
@@ -194,9 +195,10 @@
} \
else if (sizeof (__real__ (Val1)) == sizeof (double) \
|| sizeof (__real__ (Val2)) == sizeof(double) \
- || __builtin_classify_type (__real__ (Val1) \
- + __real__ (Val2))\
- != 8) \
+ || (__builtin_classify_type (__real__ (Val1)) \
+ != 8) \
+ || (__builtin_classify_type (__real__ (Val2)) \
+ != 8)) \
{ \
if (sizeof (__real__ (Val1)) == sizeof (Val1) \
&& sizeof (__real__ (Val2)) == sizeof (Val2)) \