1/* Test for unsafe floating-point conversions. */ 2/* { dg-do run } */ 3/* { dg-options "-msse2 -mfpmath=sse" } */ 4/* { dg-require-effective-target sse2 } */ 5 6#include "sse2-check.h" 7 8extern void abort (void); 9extern void exit (int); 10extern int printf(const char *, ...); 11 12volatile double d1 = 0x1.000001p0; 13volatile double d2 = 0x1p-54; 14volatile float f = 0x1.000002p0f; 15volatile float f2; 16 17static void 18sse2_test (void) 19{ 20 f2 = (float)((long double)d1 + (long double)d2); 21 if (f != f2) 22 abort (); 23 exit (0); 24} 25