1 /** Tests covering the shift operators.
10 pending - 1792, 851968, 1560281088, -3, -1792, -851968, -1560000000
15 test1ShiftClasses(void)
17 {attr} {storage} {sign} {type} i, result;
29 ASSERT(result == 120);
35 {attr} {storage} {type} i, result;
48 ASSERT(result == -15);
52 test3ShiftByteMultiples(void)
54 {attr} {storage} {type} i;
57 ASSERT(i>>8 == ({type})({vals} >> 8));
58 ASSERT(i>>16 == ({type})({vals} >> 16));
59 ASSERT(i>>24 == ({type})({vals} >> 24));
62 ASSERT( ({type})(i<<8) == ({type})({vals} << 8));;
63 ASSERT((({type}) i<<16) == (({type}) {vals} << 16));
64 ASSERT((({type}) i<<24) == (({type}) {vals} << 24));
70 {attr} {storage} {sign} {type} i;
76 ASSERT(result == ({type})(({type}){vals} >> 1));
80 ASSERT(result == ({type})(({type}){vals} >> 1));
83 ASSERT(result == ({type})(({type}){vals} << 1));
87 ASSERT(result == ({type})(({type}){vals} << 1));
90 static {type} ShiftLeftByParam ({type} count)
92 {attr} {storage} {type} i;
97 static {type} ShiftRightByParam ({type} count)
99 {attr} {storage} {type} i;
105 testShiftByParam(void)
107 ASSERT(ShiftLeftByParam(2) == ({type})({vals} << 2));
108 ASSERT(ShiftRightByParam(2) == ({type})({vals} >> 2));