2 !!DESCRIPTION!! switch test
\r
4 !!LICENCE!! public domain
\r
7 /*#define STANDALONE*/
\r
11 void testlimits(int i) {
15 case -1: /* works */
\r
16 /* case 0xffff: */ /* 'range error' (-1) */
\r
22 /* case 0x7fff: */ /* works */
\r
23 case 32767: /* works */
\r
24 /* case 32768: */ /* 'range error' (correct for that one!) */
\r
30 case -32768: /* 'warning. constant is long' */
\r
31 /* case 0x8000: */ /* 'range error' */
\r
32 /* case -32769: */ /* 'range error' (correct for that one!) */
\r
39 void testdefault1(unsigned char i) {
\r
40 /* we want a signed char */
\r
43 #ifdef REFCC_UNSIGNED_CHARS
\r
51 #ifdef UNSIGNED_CHARS
\r
61 printf(">%d\n",i);i++;
\r
95 /* triggers bug ? */
\r
96 /* gcc warning: case label value exceeds maximum value for type */
\r
97 /* cc65 error: range error */
\r
137 printf(">>>default\n");
\r
138 /* triggers bug if this break; is missing? */
\r
144 void testdefault2(unsigned char i) {
\r
145 /* we want a unsigned char */
\r
148 #ifdef REFCC_UNSIGNED_CHARS
\r
156 #ifdef UNSIGNED_CHARS
\r
166 printf(">%d\n",i);i++;
\r
200 /* triggers bug ? */
\r
239 printf(">>>default\n");
\r
240 /* triggers bug if this break; is missing? */
\r
248 testlimits(-32768);
\r