too-small long double.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57502
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-09-25 Richard Henderson <rth@redhat.com>
+
+ * gcc.c-torture/execute/ieee/20010226-1.c: Early exit for
+ too-small long double.
+
2002-09-23 Hans-Peter Nilsson <hp@axis.com>
* gcc.dg/20020919-1.c: New test.
+#include <float.h>
+
long double dfrom = 1.1;
long double m1;
long double m2;
unsigned long mant_long;
-int main( )
+int main()
{
- m1 = dfrom / 2.0;
+ /* Some targets don't support a conforming long double type. This is
+ common with very small parts which set long double == float. Look
+ to see if the type has at least 32 bits of precision. */
+ if (LDBL_EPSILON > 0x1p-31L)
+ return 0;
+ m1 = dfrom / 2.0;
m2 = m1 * 4294967296.0;
mant_long = ((unsigned long) m2) & 0xffffffff;
- if ( mant_long == 0x8ccccccc)
- exit (0);
+ if (mant_long == 0x8ccccccc)
+ return 0;
else
abort();
}