diff options
author | Richard Henderson <rth@redhat.com> | 2002-09-25 10:14:48 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-09-25 10:14:48 -0700 |
commit | 6190e14740643bdcd67fc4ff0a69c2207d0c0bf7 (patch) | |
tree | a18b8d649327787eb806d496d3a1bafc28efcc39 /gcc | |
parent | fc44b85de78353cb3930e3d59346863bf344ef93 (diff) | |
download | gcc-6190e14740643bdcd67fc4ff0a69c2207d0c0bf7.zip gcc-6190e14740643bdcd67fc4ff0a69c2207d0c0bf7.tar.gz gcc-6190e14740643bdcd67fc4ff0a69c2207d0c0bf7.tar.bz2 |
20010226-1.c: Early exit for too-small long double.
* gcc.c-torture/execute/ieee/20010226-1.c: Early exit for
too-small long double.
From-SVN: r57502
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4f95845..b4021bc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c b/gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c index 91c8da3..daa2745 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c @@ -1,17 +1,24 @@ +#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(); } |