summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug3474855.c
blob: 8fe003d04e60e990c01aa1f96f41f33ab2b93b41 (plain) (blame)
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
28
29
/*
   bug3474855.c
*/

#include <testfwk.h>

#if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
float mult(float x)
{
  return 0.8 * x;
}
#endif

void
testBug (void)
{
#if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
  unsigned char i = 64;
  float result = 1e-38;

  do
    {
      ASSERT (result < 1.5e-38);
      result = mult(result);    //make denormalized float
    }
  while (--i);
  ASSERT (result < 1e-44);
#endif
}