struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-927659.c
blobde3ce6062e2c364b3c1f787445b7ea07947bc347
1 /* bug-927659.c
3 double processing resp. reversing of params
4 */
6 #include <testfwk.h>
7 #include <stdarg.h>
8 #include <stdio.h>
10 unsigned char
11 foo(unsigned char a, ...) __reentrant
13 va_list argptr;
14 unsigned char b;
16 va_start (argptr, a);
17 b = va_arg (argptr, int);
18 va_end (argptr);
20 return b;
23 unsigned char
24 bar(unsigned char a, unsigned char b) __reentrant
26 return b / a;
29 void
30 testReverse(void)
32 ASSERT(foo (0, bar (1, 2)) == 2);
35 /*************************************************************/
37 void
38 testAddFunc(void)
40 #if !defined( __SDCC_pdk14) && !defined( __SDCC_pdk15) // Lack of memory
41 char buf[5];
42 unsigned char count = 0;
44 count += sprintf (buf, "%d", 5);
45 ASSERT(count == 1 &&
46 buf[0] == '5' &&
47 buf[1] == '\0');
48 #endif