diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr36578-2.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr36578-2.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr36578-2.c b/gcc/testsuite/gcc.target/i386/pr36578-2.c new file mode 100644 index 000000000..5d6556f55 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr36578-2.c @@ -0,0 +1,24 @@ +/* Test for unsafe floating-point conversions. */ +/* { dg-do run } */ +/* { dg-options "-msse2 -mfpmath=sse" } */ +/* { dg-require-effective-target sse2 } */ + +#include "sse2-check.h" + +extern void abort (void); +extern void exit (int); +extern int printf(const char *, ...); + +volatile double d1 = 0x1.000001p0; +volatile double d2 = 0x1p-54; +volatile float f = 0x1.000002p0f; +volatile float f2; + +static void +sse2_test (void) +{ + f2 = (float)((long double)d1 + (long double)d2); + if (f != f2) + abort (); + exit (0); +} |