diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-01-02 10:25:52 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-04-18 13:11:43 +0200 |
| commit | e1f6c18b602e9d5c61100c57bf675484db6c8826 (patch) | |
| tree | d01e007c2434007fafb2d5260380edb31e6751d8 /validation/eval | |
| parent | eb4cdd21b7d0cedbbeff7f70e24473706ccce5a6 (diff) | |
| download | sparse-dev-e1f6c18b602e9d5c61100c57bf675484db6c8826.tar.gz | |
add testcases for simplification of casts.
and remove one that didn't made much sense.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/eval')
| -rw-r--r-- | validation/eval/not-cast-bool.c | 15 | ||||
| -rw-r--r-- | validation/eval/not-cast-float.c | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/validation/eval/not-cast-bool.c b/validation/eval/not-cast-bool.c new file mode 100644 index 00000000..af422412 --- /dev/null +++ b/validation/eval/not-cast-bool.c @@ -0,0 +1,15 @@ +static _Bool foo(void) +{ + unsigned char c = 1; + _Bool b = ~c; + return b; +} + +/* + * check-name: not-cast-bool + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-returns: 1 + */ diff --git a/validation/eval/not-cast-float.c b/validation/eval/not-cast-float.c new file mode 100644 index 00000000..445b91d7 --- /dev/null +++ b/validation/eval/not-cast-float.c @@ -0,0 +1,15 @@ +static int foo(void) +{ + int i = 123; + float x = ~i; + return (x < 0); +} + +/* + * check-name: eval-bool-zext-neg + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-returns: 1 + */ |
