Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.c-torture / execute / ieee / unsafe-fp-assoc-1.c
blobc15653cd2e179592c6ae9bf4a591bc434a73f5a0
1 extern void abort();
3 typedef union {
4 struct {
5 unsigned int hi;
6 unsigned int lo;
7 } i;
8 double d;
9 } hexdouble;
11 static const double twoTo52 = 0x1.0p+52;
13 void func ( double x )
15 hexdouble argument;
16 register double y, z;
17 unsigned int xHead;
18 argument.d = x;
19 xHead = argument.i.hi & 0x7fffffff;
20 if (__builtin_expect(!!(xHead < 0x43300000u), 1))
22 y = ( x - twoTo52 ) + twoTo52;
23 if ( y != x )
24 abort();
25 z = x - 0.5;
26 y = ( z - twoTo52 ) + twoTo52;
27 if ( y == (( x - twoTo52 ) + twoTo52) )
28 abort();
30 return;
33 int main()
35 func((double)1.00);
36 return 0;