aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/pr36578-1.c
blob: 5ede23a11a8f0c17193cad67b3469409acf35ed2 (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
/* Test for unsafe floating-point conversions.  PR 36578.  */
/* { dg-do run } */
/* { dg-options "-msse2 -mfpmath=sse" } */
/* { dg-require-effective-target sse2 } */
/* { dg-require-effective-target large_long_double } */

#include "sse2-check.h"

extern void abort (void);
extern void exit (int);
extern int printf(const char *, ...);

volatile double d1 = 1.0;
volatile double d2 = 0x1.00001p-53;
volatile double d3;

static void
sse2_test (void)
{
  d3 = (double)((long double)d1 + (long double)d2);
  if (d3 != d1)
    abort ();
  exit (0);
}