diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-01-05 23:31:10 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-01-26 22:49:11 +0100 |
| commit | 5db6d62e83623808fc29f6a6da636ddf5c658110 (patch) | |
| tree | a8dc1adeeefbf263a69930aff38cdf2e1211e0b2 /validation/optim/canonical-abs.c | |
| parent | d7af8d6cc223559ece17c435dcdbd04f9ef74d3d (diff) | |
| download | sparse-dev-5db6d62e83623808fc29f6a6da636ddf5c658110.tar.gz | |
cmps: add testcases for simplification of signed compares
Signed compares miss some simplifications/canonicalizations.
Add some testcases for them.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim/canonical-abs.c')
| -rw-r--r-- | validation/optim/canonical-abs.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/validation/optim/canonical-abs.c b/validation/optim/canonical-abs.c new file mode 100644 index 00000000..0809a52d --- /dev/null +++ b/validation/optim/canonical-abs.c @@ -0,0 +1,12 @@ +_Bool abs0(int a) { return (a < 0 ? -a : a) == (a >= 0 ? a : -a); } +_Bool abs1(int a) { return (a < 0 ? -a : a) == (a > 0 ? a : -a); } +_Bool abs2(int a) { return (a < 0 ? -a : a) == (a <= 0 ? -a : a); } + +/* + * check-name: canonical-abs1 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-returns: 1 + */ |
