]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/i386/pr36578-2.c
re PR middle-end/36578 (cast to long double not taken into account when result stored...
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / i386 / pr36578-2.c
1 /* Test for unsafe floating-point conversions. */
2 /* { dg-do run } */
3 /* { dg-options "-msse2 -mfpmath=sse" } */
4
5 #include "sse2-check.h"
6
7 extern void abort (void);
8 extern void exit (int);
9 extern int printf(const char *, ...);
10
11 volatile double d1 = 0x1.000001p0;
12 volatile double d2 = 0x1p-54;
13 volatile float f = 0x1.000002p0f;
14 volatile float f2;
15
16 static void
17 sse2_test (void)
18 {
19 f2 = (float)((long double)d1 + (long double)d2);
20 if (f != f2)
21 abort ();
22 exit (0);
23 }