2 !!DESCRIPTION!! switch statement
3 !!ORIGIN!! LCC 4.1 Testsuite
4 !!LICENCE!! own, freely distributeable for non-profit. read CPYRIGHT.LCC
10 #ifdef NO_IMPLICIT_FUNC_PROTOTYPES
20 # ifdef ASSUME_32BIT_UNSIGNED
35 testbig(); /* ! broken long int compare (?) */
36 limit(); /* ! broken long int compare (?) */
43 #ifdef ASSUME_32BIT_INT
48 /* 2341234 2341234 2341234 */
49 for (i = 0x1000000; i&0x7000000; i += 0x1000000) {
50 /* printf("i = 0x%lx\n", i); */
55 #ifdef NO_LOCAL_STRING_INIT
56 /* static char _s[8]={"bfnrtvx"}; */
57 static char _s[8]="bfnrtvx";
64 #ifdef NO_STRINGS_IN_FOR
65 # ifndef NO_LOCAL_STRING_INIT
66 char _s[8]={"bfnrtvx"};
70 for (s = "bfnrtvx"; *s; s++) {
72 printf("%c = %c\n", *s, backslash(*s));
101 for (i = 0; i <= 20; i++) {
104 case 1: x = i; break;
105 case 2: x = i; break;
106 case 7: x = i; break;
107 case 8: x = i; break;
108 case 9: x = i; break;
109 case 16: x = i; break;
110 case 17: x = i; break;
111 case 18: x = i; break;
112 case 19: x = i; break;
113 case 20: x = i; break;
115 printf("x = %d\n", x);
123 for (i = 1; i <= 10; i++)
125 case 1: case 2: printf("1 %d\n", i); break;
126 case 3: case 4: case 5: printf("2 %d\n", i); break;
127 case 6: case 7: case 8: printf("3 %d\n", i);
129 printf("d %d\n", i); break;
130 case 1001: case 1002: case 1003: case 1004:
131 printf("5 %d\n", i); break;
132 case 3001: case 3002: case 3003: case 3004:
133 printf("6 %d\n", i); break;
142 for (i = 1; i <= 500; i++)
144 default: n++; continue;
145 case 128: printf("i = %d\n", i); break;
146 case 16: printf("i = %d\n", i); break;
147 case 8: printf("i = %d\n", i); break;
148 case 120: printf("i = %d\n", i); break;
149 case 280: printf("i = %d\n", i); break;
150 case 264: printf("i = %d\n", i); break;
151 case 248: printf("i = %d\n", i); break;
152 case 272: printf("i = %d\n", i); break;
153 case 304: printf("i = %d\n", i); break;
154 case 296: printf("i = %d\n", i); break;
155 case 288: printf("i = %d\n", i); break;
156 case 312: printf("i = %d\n", i); break;
158 printf("%d defaults\n", n);
161 #ifdef NO_OLD_FUNC_DECL
167 # ifdef ASSUME_32BIT_UNSIGNED
173 #ifdef NO_OLD_FUNC_DECL
179 /* printf("x = 0x%x\n", x); */
185 printf("x = 0x%lx\n", x); break;
187 printf("x = 0x%lx\n", x); break;
189 printf("x = 0x%lx\n", x); break;
191 printf("x = 0x%lx (default)\n", x); break;
198 for (i = INT_MIN; i <= INT_MIN+5; i++)
199 /* for (i = INT_MIN; i < INT_MIN+6; i++) */
201 case INT_MIN: printf("0\n"); break;
202 case INT_MIN+1: printf("1\n"); break;
203 case INT_MIN+2: printf("2\n"); break;
204 case INT_MIN+3: printf("3\n"); break;
205 case INT_MIN+4: printf("4\n"); break;
206 default: printf("5\n"); break;
208 for (i = INT_MAX; i >= INT_MAX-5; i--)
210 case INT_MAX: printf("0\n"); break;
211 case INT_MAX-1: printf("1\n"); break;
212 case INT_MAX-2: printf("2\n"); break;
213 case INT_MAX-3: printf("3\n"); break;
214 case INT_MAX-4: printf("4\n"); break;
215 default: printf("5\n"); break;