2 !!DESCRIPTION!! switch statement
3 !!ORIGIN!! LCC 4.1 Testsuite
4 !!LICENCE!! own, freely distributeable for non-profit. read CPYRIGHT.LCC
9 #ifdef NO_IMPLICIT_FUNC_PROTOTYPES
19 # ifdef ASSUME_32BIT_UNSIGNED
34 testbig(); /* ! broken long int compare (?) */
35 limit(); /* ! broken long int compare (?) */
42 #ifdef ASSUME_32BIT_INT
47 /* 2341234 2341234 2341234 */
48 for (i = 0x1000000; i&0x7000000; i += 0x1000000) {
49 /* printf("i = 0x%lx\n", i); */
54 #ifdef NO_LOCAL_STRING_INIT
55 /* static char _s[8]={"bfnrtvx"}; */
56 static char _s[8]="bfnrtvx";
63 #ifdef NO_STRINGS_IN_FOR
64 # ifndef NO_LOCAL_STRING_INIT
65 char _s[8]={"bfnrtvx"};
69 for (s = "bfnrtvx"; *s; s++) {
71 printf("%c = %c\n", *s, backslash(*s));
100 for (i = 0; i <= 20; i++) {
103 case 1: x = i; break;
104 case 2: x = i; break;
105 case 7: x = i; break;
106 case 8: x = i; break;
107 case 9: x = i; break;
108 case 16: x = i; break;
109 case 17: x = i; break;
110 case 18: x = i; break;
111 case 19: x = i; break;
112 case 20: x = i; break;
114 printf("x = %d\n", x);
122 for (i = 1; i <= 10; i++)
124 case 1: case 2: printf("1 %d\n", i); break;
125 case 3: case 4: case 5: printf("2 %d\n", i); break;
126 case 6: case 7: case 8: printf("3 %d\n", i);
128 printf("d %d\n", i); break;
129 case 1001: case 1002: case 1003: case 1004:
130 printf("5 %d\n", i); break;
131 case 3001: case 3002: case 3003: case 3004:
132 printf("6 %d\n", i); break;
141 for (i = 1; i <= 500; i++)
143 default: n++; continue;
144 case 128: printf("i = %d\n", i); break;
145 case 16: printf("i = %d\n", i); break;
146 case 8: printf("i = %d\n", i); break;
147 case 120: printf("i = %d\n", i); break;
148 case 280: printf("i = %d\n", i); break;
149 case 264: printf("i = %d\n", i); break;
150 case 248: printf("i = %d\n", i); break;
151 case 272: printf("i = %d\n", i); break;
152 case 304: printf("i = %d\n", i); break;
153 case 296: printf("i = %d\n", i); break;
154 case 288: printf("i = %d\n", i); break;
155 case 312: printf("i = %d\n", i); break;
157 printf("%d defaults\n", n);
160 #ifdef NO_OLD_FUNC_DECL
166 # ifdef ASSUME_32BIT_UNSIGNED
172 #ifdef NO_OLD_FUNC_DECL
178 /* printf("x = 0x%x\n", x); */
184 printf("x = 0x%lx\n", x); break;
186 printf("x = 0x%lx\n", x); break;
188 printf("x = 0x%lx\n", x); break;
190 printf("x = 0x%lx (default)\n", x); break;
197 for (i = INT_MIN; i <= INT_MIN+5; i++)
198 /* for (i = INT_MIN; i < INT_MIN+6; i++) */
200 case INT_MIN: printf("0\n"); break;
201 case INT_MIN+1: printf("1\n"); break;
202 case INT_MIN+2: printf("2\n"); break;
203 case INT_MIN+3: printf("3\n"); break;
204 case INT_MIN+4: printf("4\n"); break;
205 default: printf("5\n"); break;
207 for (i = INT_MAX; i >= INT_MAX-5; i--)
209 case INT_MAX: printf("0\n"); break;
210 case INT_MAX-1: printf("1\n"); break;
211 case INT_MAX-2: printf("2\n"); break;
212 case INT_MAX-3: printf("3\n"); break;
213 case INT_MAX-4: printf("4\n"); break;
214 default: printf("5\n"); break;