Fix overflows in shift primitives.
[u/mdw/catacomb] / tests / mpx
index db0230e..1603838 100644 (file)
--- a/tests/mpx
+++ b/tests/mpx
@@ -1,6 +1,6 @@
 # Test vectors for low-level MP functions
 #
-# $Id: mpx,v 1.6 2000/06/25 12:58:34 mdw Exp $
+# $Id: mpx,v 1.9 2002/10/19 18:55:08 mdw Exp $
 
 # --- Load-store tests ---
 #
@@ -20,15 +20,38 @@ load-store {
   522f8b1de257972a25ec49c9ff56340e2684e847ef2fa4d5714d7c8d454e90f6;
 }
 
+# --- Two's complement tests ---
+
+2cb {
+  "" "";
+  00 00;
+  000000 00000000000000000000;
+  01 ff;
+  0123456789abcdef fedcba9876543211;
+  0123456789abcdef fffffffedcba9876543211;
+  0100000000 ffffff00000000;
+}
+
+2cl {
+  "" "";
+  00 00;
+  000000 00000000000000000000;
+  01 ff;
+  efcdab8967452301 1132547698badcfe;
+  efcdab8967452301 1132547698badcfeffffffff;
+  0000000001 00000000ffffffff;
+}
+
 # --- Shift tests ---
 
 lsl {
-
   # --- Simple sanity checks ---
 
   01 2 04;
   01 4 10;
 
+  7 -1 0;
+
   # --- Copy shifts ---
 
   01 0 01;
@@ -108,11 +131,12 @@ lsl {
 }
 
 lsr {
-
   # --- Simple sanity checks ---
 
   04 2 01;
   10 4 01;
+  7 -1 0;
+  7 32 0;
 
   # --- Copy shifts ---