Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-floatunsisf-1.c
blobbf740cd7736c261a25f1056680d8216da54a956f
1 /*
2 floatunsisf-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* The fp-bit.c function __floatunsisf had a latent bug where guard bits
8 could be lost leading to incorrect rounding. */
9 /* Origin: Joseph Myers <joseph@codesourcery.com> */
11 #if __INT_MAX__ >= 0x7fffffff
12 volatile unsigned u = 0x80000081;
13 #else
14 volatile unsigned long u = 0x80000081;
15 #endif
16 volatile float f1, f2;
17 void
18 testTortureExecute (void)
20 #ifndef __SDCC_pdk14
21 f1 = (float) u;
22 f2 = (float) 0x80000081;
23 if (f1 != f2)
24 ASSERT (0);
25 return;
26 #endif