diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-02-16 16:38:02 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-02-17 18:38:50 +0100 |
| commit | 3e3526ff478e9abf8feb78cac84b4a0f23b8e572 (patch) | |
| tree | 7e8b9f7ae6c4eda02aa606f59e2936360a399201 /validation/expand | |
| parent | e0693cd68164948261e772a9081e155c9a95ec8f (diff) | |
| download | sparse-dev-3e3526ff478e9abf8feb78cac84b4a0f23b8e572.tar.gz | |
builtin: add testcases for expansion of special FP constants
More specifically: for __builtin_nan(), _huge_val() & _inf()
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/expand')
| -rw-r--r-- | validation/expand/builtin_huge_val.c | 39 | ||||
| -rw-r--r-- | validation/expand/builtin_nan.c | 23 |
2 files changed, 62 insertions, 0 deletions
diff --git a/validation/expand/builtin_huge_val.c b/validation/expand/builtin_huge_val.c new file mode 100644 index 00000000..09ef2a6f --- /dev/null +++ b/validation/expand/builtin_huge_val.c @@ -0,0 +1,39 @@ +static float huge_valf(void) +{ + return __builtin_huge_valf(); +} + +static double huge_val(void) +{ + return __builtin_huge_val(); +} + +static long double huge_vall(void) +{ + return __builtin_huge_vall(); +} + + +static float inff(void) +{ + return __builtin_inff(); +} + +static double inf(void) +{ + return __builtin_inf(); +} + +static long double infl(void) +{ + return __builtin_infl(); +} + +/* + * check-name: builtin_huge_val expand + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-excludes: call + */ diff --git a/validation/expand/builtin_nan.c b/validation/expand/builtin_nan.c new file mode 100644 index 00000000..20e3ae92 --- /dev/null +++ b/validation/expand/builtin_nan.c @@ -0,0 +1,23 @@ +static float nanf(void) +{ + return __builtin_nanf("0"); +} + +static double nan(void) +{ + return __builtin_nan("0"); +} + +static long double nanl(void) +{ + return __builtin_nanl("0"); +} + +/* + * check-name: builtin_nan expand + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-excludes: call + */ |
