struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2376.c
blob6748e2de6cb3d0c6fc113e65aed0689cb9c1ea15
1 /*
2 bug-2195.c
4 A peephole optimizer bug in calls to __z88dk_fastcall.
5 */
7 #include <string.h>
8 #include <testfwk.h>
10 char v[5];
12 void kputchar(unsigned char c) __z88dk_fastcall
14 static int i;
15 v[i++] = c;
18 void kputs(const char *p) __z88dk_fastcall
20 while(*p)
21 kputchar(*p++); /* The bug resulted in the peephole optimizer optimizing out the parameter to this call */
24 void testBug(void)
26 const char *s = "test";
27 kputs(s);
28 ASSERT(!strcmp(s, v));