diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-02-16 16:55:08 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-02-17 18:38:50 +0100 |
| commit | d7529936fa7dfdff32885b3a96473883e6b70fa3 (patch) | |
| tree | 31132d586618fc2cfb9f57f723972dca883d96b0 /validation/expand/builtin_isinf.c | |
| parent | 3e3526ff478e9abf8feb78cac84b4a0f23b8e572 (diff) | |
| download | sparse-dev-d7529936fa7dfdff32885b3a96473883e6b70fa3.tar.gz | |
builtin: add testcases for expansion of FP classification
__builtin_isinf(), isnan() & isnormal() are all special cases
of __builtin_fpclassify().
Add a few cases testing if those are correctly expanded if
when the argument is a constant.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/expand/builtin_isinf.c')
| -rw-r--r-- | validation/expand/builtin_isinf.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/validation/expand/builtin_isinf.c b/validation/expand/builtin_isinf.c new file mode 100644 index 00000000..36b20a60 --- /dev/null +++ b/validation/expand/builtin_isinf.c @@ -0,0 +1,20 @@ +int test(void) +{ + if (!__builtin_isinf(__builtin_inff())) + return 0; + if (!__builtin_isinf(__builtin_inf())) + return 0; + if (!__builtin_isinf(__builtin_infl())) + return 0; + + return 1; +} + +/* + * check-name: builtin_isinf expand + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-contains: ret\\..*\\$1 + */ |
