+2013-06-12 Joseph Myers <joseph@codesourcery.com>
+
+ * math/bug-nextafter.c: Include <math-tests.h>.
+ (main): Only test for exceptions if EXCEPTION_TESTS is true for
+ the relevant type.
+ * math/bug-nexttoward.c: Include <math-tests.h>.
+ (main): Only test for exceptions if EXCEPTION_TESTS is true for
+ the relevant type.
+ * math/test-misc.c: Include <math-tests.h>.
+ (main): Only test for exceptions if EXCEPTION_TESTS is true for
+ the relevant type.
+
2013-06-12 Andreas Jaeger <aj@suse.de>
* po/ia.po: Update Interlingua translation from translation
#include <float.h>
#include <stdlib.h>
#include <stdio.h>
+#include <math-tests.h>
#if !defined(FE_OVERFLOW) && !defined(FE_UNDERFLOW)
/* If there's no support for the exceptions this test is checking,
puts ("nextafterf+ failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafterf+ did not overflow");
++result;
puts ("nextafterf- failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafterf- did not overflow");
++result;
puts ("nextafterf+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf+ did not underflow");
++result;
puts ("nextafterf- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf- did not underflow");
++result;
puts ("nextafterf+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf+ did not underflow");
++result;
puts ("nextafterf+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf+ did not underflow");
++result;
puts ("nextafterf- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf- did not underflow");
++result;
puts ("nextafterf- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterf- did not underflow");
++result;
puts ("nextafter+ failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafter+ did not overflow");
++result;
puts ("nextafter failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafter- did not overflow");
++result;
puts ("nextafter+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter+ did not underflow");
++result;
puts ("nextafter- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter- did not underflow");
++result;
puts ("nextafter+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter+ did not underflow");
++result;
puts ("nextafter+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter+ did not underflow");
++result;
puts ("nextafter- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter- did not underflow");
++result;
puts ("nextafter- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafter- did not underflow");
++result;
puts ("nextafterl+ failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafterl+ did not overflow");
++result;
puts ("nextafterl failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nextafterl- did not overflow");
++result;
puts ("nextafterl+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl+ did not underflow");
++result;
puts ("nextafterl- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl- did not underflow");
++result;
puts ("nextafterl+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl+ did not underflow");
++result;
puts ("nextafterl+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl+ did not underflow");
++result;
puts ("nextafterl- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl- did not underflow");
++result;
puts ("nextafterl- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nextafterl- did not underflow");
++result;
#include <float.h>
#include <stdlib.h>
#include <stdio.h>
+#include <math-tests.h>
#if !defined(FE_OVERFLOW) && !defined(FE_UNDERFLOW)
/* If there's no support for the exceptions this test is checking,
puts ("nexttowardf+ failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nexttowardf+ did not overflow");
++result;
puts ("nexttowardf- failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nexttowardf- did not overflow");
++result;
puts ("nexttowardf+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardf+ did not underflow");
++result;
puts ("nexttowardf- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardf- did not underflow");
++result;
puts ("nexttowardf+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardf+ did not underflow");
++result;
puts ("nexttowardf+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardf+ did not underflow");
++result;
puts ("nexttowardf- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardf- did not underflow");
++result;
puts ("nexttowardf- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (float) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardf- did not underflow");
++result;
puts ("nexttoward+ failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nexttoward+ did not overflow");
++result;
puts ("nexttoward- failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nexttoward- did not overflow");
++result;
puts ("nexttoward+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttoward+ did not underflow");
++result;
puts ("nexttoward- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttoward- did not underflow");
++result;
puts ("nexttoward+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttoward+ did not underflow");
++result;
puts ("nexttoward+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttoward+ did not underflow");
++result;
puts ("nexttoward- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttoward- did not underflow");
++result;
puts ("nexttoward- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttoward- did not underflow");
++result;
puts ("nexttowardl+ failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nexttowardl+ did not overflow");
++result;
puts ("nexttowardl failed");
++result;
}
- if (fetestexcept (FE_OVERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_OVERFLOW) == 0)
{
puts ("nexttowardl- did not overflow");
++result;
puts ("nexttowardl+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardl+ did not underflow");
++result;
puts ("nexttowardl- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardl- did not underflow");
++result;
puts ("nexttowardl+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardl+ did not underflow");
++result;
puts ("nexttowardl+ failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardl+ did not underflow");
++result;
puts ("nexttowardl- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardl- did not underflow");
++result;
puts ("nexttowardl- failed");
++result;
}
- if (fetestexcept (FE_UNDERFLOW) == 0)
+ if (EXCEPTION_TESTS (long double) && fetestexcept (FE_UNDERFLOW) == 0)
{
puts ("nexttowardl- did not underflow");
++result;
#include <math.h>
#include <stdio.h>
#include <string.h>
+#include <math-tests.h>
int
f2 += f1;
#if defined(FE_OVERFLOW) && defined(FE_INEXACT)
int fe = fetestexcept (FE_ALL_EXCEPT);
- if (fe != (FE_OVERFLOW | FE_INEXACT))
+ if (EXCEPTION_TESTS (float) && fe != (FE_OVERFLOW | FE_INEXACT))
{
printf ("float overflow test failed: %x\n", fe);
result = 1;
d2 += d1;
#if defined(FE_OVERFLOW) && defined(FE_INEXACT)
fe = fetestexcept (FE_ALL_EXCEPT);
- if (fe != (FE_OVERFLOW | FE_INEXACT))
+ if (EXCEPTION_TESTS (double) && fe != (FE_OVERFLOW | FE_INEXACT))
{
printf ("double overflow test failed: %x\n", fe);
result = 1;
ld2 += ld1;
# if defined(FE_OVERFLOW) && defined(FE_INEXACT)
fe = fetestexcept (FE_ALL_EXCEPT);
- if (fe != (FE_OVERFLOW | FE_INEXACT))
+ if (EXCEPTION_TESTS (long double) && fe != (FE_OVERFLOW | FE_INEXACT))
{
printf ("long double overflow test failed: %x\n", fe);
result = 1;