2 !!DESCRIPTION!! Shift bytes left and right by a variable.
3 !!ORIGIN!! SDCC regression tests
4 !!LICENCE!! GPL, read COPYING.GPL
10 unsigned char success=0;
11 unsigned char failures=0;
12 unsigned char dummy=0;
14 #ifdef SUPPORT_BIT_TYPES
17 #ifdef SIZEOF_INT_16BIT
18 #if defined(__LINUX__) || defined(LINUX)
19 signed short aint0 = 0;
20 signed short aint1 = 0;
33 signed char achar0 = 0;
34 signed char achar1 = 0;
35 signed char achar2 = 0;
36 signed char achar3 = 0;
43 void shift_right_var(void)
48 void shift_left_var(void)
53 void shift_int_left_var(void)
58 void shift_int_right_var(void)
63 void shift_int_right_var2(void)
65 aint0 = aint1 >> achar1;
68 void shift_int_left_var2(void)
70 aint0 = aint1 << achar1;
84 printf("failures: %d\n",failures);
96 printf("failures: %d\n",failures);
101 if(((unsigned char)achar0) != 0xff)
103 printf("failures: %d\n",failures);
109 for(i=0; i<15; i++) {
110 shift_int_left_var();
115 printf("failures: %d\n",failures);
120 for(i=0; i<15; i++) {
121 shift_int_right_var();
126 printf("failures: %d\n",failures);
131 for(i=0; i<15; i++) {
132 shift_int_right_var();
137 printf("failures: %d\n",failures);
141 shift_int_right_var2();
143 if(((unsigned short)aint0) != 0xfffc)
145 printf("failures: %d\n",failures);
148 shift_int_left_var2();
150 if(((unsigned short)aint0) != 0xf000)
155 printf("failures: %d\n",failures);