blob: bfde2cb0ffa6de295536a8f85af17bc50f86e1b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/* 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 double d2d = 0x1p-52;
volatile float f = 0x1.000002p0f;
volatile float f2;
static void
sse2_test (void)
{
if (sizeof(long double) > sizeof(double) ) {
f2 = (float)((long double)d1 + (long double)d2);
} else {
f2 = (float)((long double)d1 + (long double)d2d);
}
if (f != f2)
abort ();
exit (0);
}
|