struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug3368945.c
blob2efc4d3e1313572ebb1940a855fde395c8431d57
1 /*
2 bug-2890326.c
3 */
5 #include <testfwk.h>
7 unsigned short _sLineLen;
8 unsigned char *_pLine;
10 void line_add_crlf()
12 _pLine[_sLineLen] = '\r';
13 _sLineLen ++;
14 _pLine[_sLineLen] = '\n';
15 _sLineLen ++;
16 _pLine[_sLineLen] = 0;
19 void testBug(void)
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);