aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-01-31 14:51:33 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-03-10 11:28:20 +0100
commit520454ec595c50050740d9375047c897f1cf3339 (patch)
tree5b70a69738e113fb4ecc6076652c12e1a742f727
parent5e674421d5f144612a8d39cafae557bbfa7026fa (diff)
downloadsparse-520454ec595c50050740d9375047c897f1cf3339.tar.gz
change testing of signed compares against SMIN or SMAX
These tests are written by testing if the comparisons are equal to their expected value: 0 or 1. So, a compare of a compare but such compares of compare have their own simplification which defeats what's tested here. So, rewrite the test to avoid such compares of compare. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--validation/optim/cmps-minmax.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/validation/optim/cmps-minmax.c b/validation/optim/cmps-minmax.c
index 5802cdbc..0b1a0a09 100644
--- a/validation/optim/cmps-minmax.c
+++ b/validation/optim/cmps-minmax.c
@@ -1,11 +1,11 @@
#define SMAX __INT_MAX__
#define SMIN (-__INT_MAX__-1)
-int lt_smin(int a) { return (a < SMIN) == 0; }
-int le_smax(int a) { return (a <= SMAX) == 1; }
+int lt_smin(int a) { return (a < SMIN) + 1; }
+int le_smax(int a) { return (a <= SMAX) + 0; }
-int ge_smin(int a) { return (a >= SMIN) == 1; }
-int gt_smax(int a) { return (a > SMAX) == 0; }
+int ge_smin(int a) { return (a >= SMIN) + 0; }
+int gt_smax(int a) { return (a > SMAX) + 1; }
/*
* check-name: cmps-minmax