* src/z80/gen.c (genCmp): Fixed compare on unsigned.
[fw/sdcc] / support / regression / tests / compare.c
index f6e9ee6c5c47283ac304c56dfd22e97660d25a17..f058c3a649c63c4c17625ef3fbde12f248d09f0b 100644 (file)
@@ -88,6 +88,19 @@ testCompareVariables(void)
     ASSERT(left >= right);
 }
 
+static void
+testUnsignedCompare(void)
+{
+    {attr} {storage} unsigned {type} left, right;
+
+    left = 0;
+    right = (unsigned {type})-1;
+
+    ASSERT(left < right);
+    ASSERT(left <= right);
+    ASSERT(right > left);
+    ASSERT(right >= left);
+}
 /*
                 Common cases:
                         Around zero