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
/
bug3368945.c
blob
2efc4d3e1313572ebb1940a855fde395c8431d57
1
/*
2
bug-2890326.c
3
*/
4
5
#include <testfwk.h>
6
7
unsigned short
_sLineLen
;
8
unsigned char
*
_pLine
;
9
10
void
line_add_crlf
()
11
{
12
_pLine
[
_sLineLen
] =
'
\r
'
;
13
_sLineLen
++;
14
_pLine
[
_sLineLen
] =
'
\n
'
;
15
_sLineLen
++;
16
_pLine
[
_sLineLen
] =
0
;
17
}
18
19
void
testBug
(
void
)
20
{
21
unsigned char
b
[
4
];
22
_sLineLen
=
0
;
23
_pLine
=
b
;
24
line_add_crlf
();
25
ASSERT
(
b
[
1
] ==
'
\n
'
);
26
ASSERT
(!
b
[
2
]);
27
ASSERT
(
_sLineLen
==
2
);
28
}
29