summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/ieee/930529-1.c
blob: b96a3c064232552a48e8c088890b5928373d1716 (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
main ()
{
  union {
    double d;
    unsigned char c[8];
  } d;

  d.d = 1.0/7.0;

  if (sizeof (char) * 8 == sizeof (double))
    {
      if (d.c[0] == 0x92 && d.c[1] == 0x24 && d.c[2] == 0x49 && d.c[3] == 0x92
	  && d.c[4] == 0x24 && d.c[5] == 0x49 && d.c[6] == 0xc2 && d.c[7] == 0x3f)
	exit (0);
      if (d.c[7] == 0x92 && d.c[6] == 0x24 && d.c[5] == 0x49 && d.c[4] == 0x92
	  && d.c[3] == 0x24 && d.c[2] == 0x49 && d.c[1] == 0xc2 && d.c[0] == 0x3f)
	exit (0);
#if defined __arm__ || defined __thumb__
      if (d.c[4] == 0x92 && d.c[5] == 0x24 && d.c[6] == 0x49 && d.c[7] == 0x92
	  && d.c[0] == 0x24 && d.c[1] == 0x49 && d.c[2] == 0xc2 && d.c[3] == 0x3f)
	exit (0);
#endif
      abort ();
    }

  exit (0);
}