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_isnan.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_isnan.c')
| -rw-r--r-- | validation/expand/builtin_isnan.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/validation/expand/builtin_isnan.c b/validation/expand/builtin_isnan.c new file mode 100644 index 00000000..07c7e5e5 --- /dev/null +++ b/validation/expand/builtin_isnan.c @@ -0,0 +1,20 @@ +int test(void) +{ + if (!__builtin_isnan(__builtin_nanf("0"))) + return 0; + if (!__builtin_isnan(__builtin_nan("0"))) + return 0; + if (!__builtin_isnan(__builtin_nanl("0"))) + return 0; + + return 1; +} + +/* + * check-name: builtin_isnan expand + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-contains: ret\\..*\\$1 + */ |
