Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / oldfmul.c
blobd85644d6953aac88ec58012f4e14032f9a1dbb20
1 /*
2 oldfmul.c - a bug that resulted in wrong results in an old float multiplication routine.
3 */
5 #include <testfwk.h>
7 union float_long
9 float f;
10 unsigned long l;
13 #define HIDDEN (unsigned long)(1ul << 23)
15 void lmul (unsigned long l, unsigned long r)
17 ASSERT (l == HIDDEN >> 8);
18 ASSERT (r == HIDDEN >> 8);
22 void oldfmul11 (void) {
23 volatile union float_long fl1, fl2;
25 fl1.l = HIDDEN;
26 fl2.l = HIDDEN;
28 lmul((fl1.l >> 8), (fl2.l >> 8));
31 void
32 testBug (void)
34 oldfmul11 ();