Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-500536.c
blob06ca82567723da318222d5e9c1cb0890ffc80446
1 /* Bad mangaling of support names.
2 */
3 #include <testfwk.h>
5 /* The original bug */
6 float z1(void)
8 return 5;
11 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
12 float fun( void )
14 unsigned long i;
15 float f;
16 i=5.5 * z1();
17 f=i;
18 if (i & 1)
19 f += 1.0;
20 return f;
22 #endif
24 /* Tests to check basic conversion */
25 void
26 testfs2long(void)
28 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
29 volatile float f;
30 volatile unsigned long ul;
31 volatile long l;
33 f = 5.0;
34 ul = f;
35 ASSERT(ul == 5);
37 l = f;
38 ASSERT(l == 5);
40 f = -134;
41 l = f;
42 ASSERT(l == -134);
44 l = 4567;
45 f = l;
46 ASSERT(f == 4567.0);
48 l = -1539;
49 f = l;
50 ASSERT(f == -1539.0);
52 ul = 9995;
53 f = ul;
54 ASSERT(f == 9995.0);
55 #endif