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-and0.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-and0.c')
| -rw-r--r-- | validation/optim/cmps-and0.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/validation/optim/cmps-and0.c b/validation/optim/cmps-and0.c new file mode 100644 index 00000000..097ec2f9 --- /dev/null +++ b/validation/optim/cmps-and0.c @@ -0,0 +1,22 @@ +#define MINUS_ONE -1 +#define MASK 32 + + +int cmps_and_lt_lt0(int a) { return ((a & MASK) < MINUS_ONE) + 1; } +int cmps_and_lt_gtm(int a) { return ((a & MASK) < (MASK + 1)) + 0; } +int cmps_and_le_lt0(int a) { return ((a & MASK) <= MINUS_ONE) + 1; } +int cmps_and_le_gtm(int a) { return ((a & MASK) <= (MASK + 1)) + 0; } + +int cmps_and_gt_lt0(int a) { return ((a & MASK) > MINUS_ONE) + 0; } +int cmps_and_gt_gtm(int a) { return ((a & MASK) > (MASK + 1)) + 1; } +int cmps_and_ge_lt0(int a) { return ((a & MASK) >= MINUS_ONE) + 0; } +int cmps_and_ge_gtm(int a) { return ((a & MASK) >= (MASK + 1)) + 1; } + +/* + * check-name: cmps-and0 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-returns: 1 + */ |
