X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=support%2Fregression%2Ftests%2Fonebyte.c;h=a6ffc9d192059c76b772f5234f5c6cf6fc484881;hb=5be90381bf67a833edd640da0d67400b3bb0f111;hp=7f4e2fbbc368fde70dd8d7ca8e498b400c4e28b3;hpb=7dc0e9e24d28df3ef106c8a3e29f32fee371ae03;p=fw%2Fsdcc diff --git a/support/regression/tests/onebyte.c b/support/regression/tests/onebyte.c index 7f4e2fbb..a6ffc9d1 100644 --- a/support/regression/tests/onebyte.c +++ b/support/regression/tests/onebyte.c @@ -186,3 +186,20 @@ testComplement(void) ASSERT(~ (char) 0x80 == (short) 0x007f); ASSERT(~ (char) 0x80 > 0); ASSERT(~ (unsigned char) 0x80 == (short) 0xff7f); ASSERT(~ (unsigned char) 0x80 < 0); } + +void +testComp(void) +{ + {attrL} signed char c; + {attrR} unsigned char uc; + + c = 0x80; /* -128 */ + uc = 0x80; /* +128 */ + + ASSERT(!(c == uc)); + ASSERT( c != uc ); + ASSERT( c < uc ); + ASSERT( c <= uc ); + ASSERT(!(c > uc)); + ASSERT(!(c >= uc)); +}