repo.or.cz
/
sdcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
struct / union in initializer, RFE #901.
[sdcc.git]
/
sdcc
/
support
/
regression
/
tests
/
scott-b.c
blob
534253bd78d6d016e575e91ada717833e9af3fa4
1
/*
2
*/
3
#include <testfwk.h>
4
5
unsigned char
uchar0
=
0
;
6
unsigned char
uchar1
=
0
;
7
unsigned char
uchar2
=
0
;
8
9
void
inc
(
unsigned char
k
)
10
{
11
uchar0
=
uchar0
+
k
;
12
}
13
14
void
f1
(
void
)
15
{
16
17
uchar2
++;
18
}
19
20
void
nested_call
(
unsigned char
u
)
21
{
22
23
f1
();
24
uchar1
=
uchar1
+
u
;
25
inc
(
uchar1
);
26
27
}
28
// uchar1 = uchar1 + uchar0;
29
// uchar2 = uchar1 + k;
30
31
void
32
testB
(
void
)
33
{
34
35
uchar0
=
1
;
36
inc
(
uchar0
);
37
ASSERT
(
uchar0
==
2
);
38
39
uchar0
=
2
;
40
uchar1
=
1
;
41
uchar2
=
1
;
42
nested_call
(
uchar2
);
43
44
ASSERT
(
uchar0
==
4
);
45
}