* src/pic/ralloc.c (debugLogRegType): Removed some old types to get it to compile.
[fw/sdcc] / support / regression / tests / bug-460000.c
diff --git a/support/regression/tests/bug-460000.c b/support/regression/tests/bug-460000.c
new file mode 100644 (file)
index 0000000..934ae48
--- /dev/null
@@ -0,0 +1,44 @@
+/* bug 460000
+ */
+#include <testfwk.h>
+
+int 
+func( int a )
+{
+  return a;
+}
+
+int x = -1024; 
+
+void 
+testByteShift(void) 
+{ 
+  ASSERT(func( x >> 8 ) == -4);
+  ASSERT(func( x / 256 ) == -4);
+} 
+
+void
+testOtherSignedShifts(void)
+{
+  volatile int left;
+
+  left = -2345;
+  ASSERT(left >> 3 == (-2345>>3));
+  ASSERT(left >> 8 == (-2345>>8));
+  ASSERT(left >> 9 == (-2345>>9));
+}
+
+void
+testShiftByParam(void)
+{
+  volatile int left, count;
+
+  left = -2345;
+
+  count = 3;
+  ASSERT(left >> count == (-2345>>3));
+  count = 8;
+  ASSERT(left >> count == (-2345>>8));
+  count = 9;
+  ASSERT(left >> count == (-2345>>9));
+}