struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2231.c
blob6b9a9da91f9bd2c157864ea03376226cd2131727
1 /* bug-2231.c
2 */
4 #include <testfwk.h>
5 #include <string.h>
7 char src[12] = "Hello World";
8 char dst[16] = "***************";
10 void testBug(void)
12 #ifndef __SDCC_pdk14 // Lack of memory
13 strncpy(dst, src, 5);
14 ASSERT(0 == memcmp(dst, "Hello**********", 16));
15 strncpy(dst, src, 15);
16 ASSERT(0 == memcmp(dst, "Hello World\0\0\0\0", 16));
17 #endif