projects
/
fw
/
sdcc
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Added
[fw/sdcc]
/
support
/
regression
/
tests
/
bug-500536.c
1
/* Bad mangaling of support names.
2
*/
3
#include <testfwk.h>
4
5
/* The original bug */
6
float z1(void)
7
{
8
return 5;
9
}
10
11
float fun( void )
12
{
13
unsigned long i;
14
float f;
15
i=5.5 * z1();
16
f=i;
17
if (i & 1)
18
f += 1.0;
19
return f;
20
}
21
22
/* Tests to check basic conversion */
23
void
24
testfs2long(void)
25
{
26
volatile float f;
27
volatile unsigned long ul;
28
volatile long l;
29
30
f = 5.0;
31
ul = f;
32
ASSERT(ul == 5);
33
34
l = f;
35
ASSERT(l == 5);
36
37
f = -134;
38
l = f;
39
ASSERT(l == -134);
40
41
l = 4567;
42
f = l;
43
ASSERT(f == 4567.0);
44
45
l = -1539;
46
f = l;
47
ASSERT(f == -1539.0);
48
49
ul = 9995;
50
f = ul;
51
ASSERT(f == 9995.0);
52
}