* src/regression/ptrarg.c: added, fails due to bug #1430967
[fw/sdcc] / src / regression / rotate3.c
1 #include "gpsim_assert.h"
2 // Shift ints left and right
3
4 unsigned char failures=0;
5
6 bit bit0 = 0;
7 unsigned int aint0 = 0;
8 unsigned int aint1 = 0;
9 unsigned char achar0 = 0;
10 unsigned char achar1 = 0;
11 unsigned char achar2 = 0;
12 unsigned char achar3 = 0;
13
14 void
15 done()
16 {
17   ASSERT(MANGLE(failures) == 0);
18   PASSED();
19 }
20
21 void shift_int_left_1(void)
22 {
23
24   aint0 <<= 1;
25
26 }
27
28 void shift_int_left_2(void)
29 {
30
31   aint0 <<= 2;
32
33 }
34
35 void shift_int_left_3(void)
36 {
37
38   aint0 <<= 3;
39
40 }
41
42 void shift_int_left_4(void)
43 {
44
45   aint0 <<= 4;
46
47 }
48
49 void shift_int_left_5(void)
50 {
51
52   aint0 <<= 5;
53
54 }
55
56 void shift_int_left_6(void)
57 {
58
59   aint0 <<= 6;
60
61 }
62
63 void shift_int_left_7(void)
64 {
65
66   aint0 <<= 7;
67
68 }
69
70 void shift_int_left_8(void)
71 {
72
73   aint0 <<= 8;
74
75 }
76
77 void shift_int_left_9(void)
78 {
79
80   aint0 <<= 9;
81
82 }
83
84 void shift_int_left_10(void)
85 {
86
87   aint0 <<= 10;
88
89 }
90
91 void shift_int_left_11(void)
92 {
93
94   aint0 <<= 11;
95
96 }
97
98 void shift_int_left_12(void)
99 {
100
101   aint0 <<= 12;
102
103 }
104
105 void shift_int_left_13(void)
106 {
107
108   aint0 <<= 13;
109
110 }
111
112 void shift_int_left_14(void)
113 {
114
115   aint0 <<= 14;
116
117 }
118
119 void shift_int_left_15(void)
120 {
121
122   aint0 <<= 15;
123
124 }
125
126 /*****************************************************/
127 void shift_int_right_1(void)
128 {
129   aint0 >>= 1;
130 }
131
132 void shift_int_right_2(void)
133 {
134   aint0 >>= 2;
135 }
136
137 void shift_int_right_3(void)
138 {
139   aint0 >>= 3;
140 }
141
142 void shift_int_right_4(void)
143 {
144   aint0 >>= 4;
145 }
146
147 void shift_int_right_5(void)
148 {
149   aint0 >>= 5;
150 }
151
152 void shift_int_right_6(void)
153 {
154   aint0 >>= 6;
155 }
156
157 void shift_int_right_7(void)
158 {
159   aint0 >>= 7;
160 }
161
162 void shift_int_right_8(void)
163 {
164   aint0 >>= 8;
165 }
166
167 void shift_int_right_9(void)
168 {
169   aint0 >>= 9;
170 }
171
172 void shift_int_right_10(void)
173 {
174   aint0 >>= 10;
175 }
176
177 void shift_int_right_11(void)
178 {
179   aint0 >>= 11;
180 }
181
182 void shift_int_right_12(void)
183 {
184   aint0 >>= 12;
185 }
186
187 void shift_int_right_13(void)
188 {
189   aint0 >>= 13;
190 }
191
192 void shift_int_right_14(void)
193 {
194   aint0 >>= 14;
195 }
196
197 void shift_int_right_15(void)
198 {
199   aint0 >>= 15;
200 }
201
202 /*****************************************************/
203 void main(void)
204 {
205   //char i;
206
207   aint0 = 0xabcd;
208
209   shift_int_left_1();
210   if(aint0 != 0x579a)
211     failures++;
212
213   aint0 = 0xabcd;
214
215   shift_int_left_2();
216   if(aint0 != 0xaf34)
217     failures++;
218
219   aint0 = 0xabcd;
220
221   shift_int_left_3();
222   if(aint0 != 0x5e68)
223     failures++;
224
225   aint0 = 0xabcd;
226
227   shift_int_left_4();
228   if(aint0 != 0xbcd0)
229     failures++;
230
231   aint0 = 0xabcd;
232
233   shift_int_left_5();
234   if(aint0 != 0x79a0)
235     failures++;
236
237   aint0 = 0xabcd;
238
239   shift_int_left_6();
240   if(aint0 != 0xf340)
241     failures++;
242
243   aint0 = 0xabcd;
244
245   shift_int_left_7();
246   if(aint0 != 0xe680)
247     failures++;
248
249   aint0 = 0xabcd;
250
251   shift_int_left_8();
252   if(aint0 != 0xcd00)
253     failures++;
254
255   aint0 = 0xabcd;
256
257   shift_int_left_9();
258   if(aint0 != 0x9a00)
259     failures++;
260
261   aint0 = 0xabcd;
262
263   shift_int_left_10();
264   if(aint0 != 0x3400)
265     failures++;
266
267   aint0 = 0xabcd;
268
269   shift_int_left_11();
270   if(aint0 != 0x6800)
271     failures++;
272
273   aint0 = 0xabcd;
274
275   shift_int_left_12();
276   if(aint0 != 0xd000)
277     failures++;
278
279   aint0 = 0xabcd;
280
281   shift_int_left_13();
282   if(aint0 != 0xa000)
283     failures++;
284
285   aint0 = 0xabcd;
286
287   shift_int_left_14();
288   if(aint0 != 0x4000)
289     failures++;
290
291   aint0 = 0xabcd;
292
293   shift_int_left_15();
294   if(aint0 != 0x8000)
295     failures++;
296
297   /***********************/
298   aint0 = 0xabcd;
299
300   shift_int_right_1();
301   if(aint0 != 0x55e6)
302     failures++;
303
304   aint0 = 0xabcd;
305
306   shift_int_right_2();
307   if(aint0 != 0x2af3)
308     failures++;
309
310   aint0 = 0xabcd;
311
312   shift_int_right_3();
313   if(aint0 != 0x1579)
314     failures++;
315
316   aint0 = 0xabcd;
317
318   shift_int_right_4();
319   if(aint0 != 0x0abc)
320     failures++;
321
322   aint0 = 0xabcd;
323
324   shift_int_right_5();
325   if(aint0 != 0x055e)
326     failures++;
327
328   aint0 = 0xabcd;
329
330   shift_int_right_6();
331   if(aint0 != 0x02af)
332     failures++;
333
334   aint0 = 0xabcd;
335
336   shift_int_right_7();
337   if(aint0 != 0x0157)
338     failures++;
339
340   aint0 = 0xabcd;
341
342   shift_int_right_8();
343   if(aint0 != 0x00ab)
344     failures++;
345
346   aint0 = 0xabcd;
347
348   shift_int_right_9();
349   if(aint0 != 0x0055)
350     failures++;
351
352   aint0 = 0xabcd;
353
354   shift_int_right_10();
355   if(aint0 != 0x002a)
356     failures++;
357
358   aint0 = 0xabcd;
359
360   shift_int_right_11();
361   if(aint0 != 0x0015)
362     failures++;
363
364   aint0 = 0xabcd;
365
366   shift_int_right_12();
367   if(aint0 != 0x000a)
368     failures++;
369
370   aint0 = 0xabcd;
371
372   shift_int_right_13();
373   if(aint0 != 0x0005)
374     failures++;
375
376   aint0 = 0xabcd;
377
378   shift_int_right_14();
379   if(aint0 != 0x0002)
380     failures++;
381
382   aint0 = 0xabcd;
383
384   shift_int_right_15();
385   if(aint0 != 0x0001)
386     failures++;
387
388   done();
389 }