diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-01-31 14:51:33 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-03-10 15:27:19 +0100 |
| commit | b9429057955ed194b072ca181d61c47c562ebcaa (patch) | |
| tree | b70f4218fb3240f7f4225b180062e587336c450f /validation/optim/cmps-or0.c | |
| parent | 520454ec595c50050740d9375047c897f1cf3339 (diff) | |
| download | sparse-dev-b9429057955ed194b072ca181d61c47c562ebcaa.tar.gz | |
add testcases for constant compares against AND/OR
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim/cmps-or0.c')
| -rw-r--r-- | validation/optim/cmps-or0.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/validation/optim/cmps-or0.c b/validation/optim/cmps-or0.c new file mode 100644 index 00000000..40a2092c --- /dev/null +++ b/validation/optim/cmps-or0.c @@ -0,0 +1,22 @@ +#define EQ(X) + (X == 0) +#define SIGN (1 << 31) +#define MASK (SIGN | 32) + + +int cmps_ior_lt_x(int a) { return ((a | MASK) < 4) EQ(1); } +int cmps_ior_lt_0(int a) { return ((a | MASK) < 0) EQ(1); } +int cmps_ior_le_x(int a) { return ((a | MASK) <= 4) EQ(1); } +int cmps_ior_le_0(int a) { return ((a | MASK) <= 0) EQ(1); } +int cmps_ior_ge_x(int a) { return ((a | MASK) >= 4) EQ(0); } +int cmps_ior_ge_0(int a) { return ((a | MASK) >= 0) EQ(0); } +int cmps_ior_gt_x(int a) { return ((a | MASK) > 4) EQ(0); } +int cmps_ior_gt_0(int a) { return ((a | MASK) > 0) EQ(0); } + +/* + * check-name: cmps-or0 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-returns: 1 + */ |
