Currently, bitwise types are restricted to bitwise operations (&, |, ^ and ~) as well as equality comparisons. This patch makes the others comparisons valid for bitwise types too. Warning: This change make sense in the context of [1] but doesn't make sense for the 'main' bitwise types: __be32 and friends. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- evaluate.c | 4 ++++ validation/bitwise-cmp.c | 1 - validation/linear/bitwise-cmps.c | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/evaluate.c b/evaluate.c index bcbcdf1ef0cc..bb8c0caa905a 100644 --- a/evaluate.c +++ b/evaluate.c @@ -435,6 +435,10 @@ static int restricted_binop(int op, struct symbol *type) case '^': case '?': return 2; /* keep fouled */ + case '<': + case '>': + case SPECIAL_LTE: + case SPECIAL_GTE: case SPECIAL_EQUAL: case SPECIAL_NOTEQUAL: return 3; /* warn if fouled */ diff --git a/validation/bitwise-cmp.c b/validation/bitwise-cmp.c index ca12b5e51e8e..8c3e6894072d 100644 --- a/validation/bitwise-cmp.c +++ b/validation/bitwise-cmp.c @@ -28,5 +28,4 @@ static int gtx(b32 x, b32 y) { return (x > y); } /* * check-name: bitwise-cmp - * check-known-to-fail */ diff --git a/validation/linear/bitwise-cmps.c b/validation/linear/bitwise-cmps.c index 6122944a42c6..f83ab7fe47db 100644 --- a/validation/linear/bitwise-cmps.c +++ b/validation/linear/bitwise-cmps.c @@ -8,7 +8,6 @@ static int gtu(bs32 x, bs32 y) { return (x > y); } /* * check-name: bitwise-cmps * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-excludes: setb\\. -- 2.36.1