diff options
author | Michael Stefaniuc <mstefani@redhat.com> | 2015-04-08 23:48:39 +0200 |
---|---|---|
committer | Christopher Li <sparse@chrisli.org> | 2015-04-21 16:26:50 -0700 |
commit | efd34fafe5cba2eedfe889e49698f5eb119547bd (patch) | |
tree | 51c4b3c0aa71cddcaef7f0061fea5bc480d372be | |
parent | 0f71312959ed8f7692deaedeb35d7612004f8d72 (diff) | |
download | sparse-efd34fafe5cba2eedfe889e49698f5eb119547bd.tar.gz |
Add tests for the builtin INF and nan() functions.
Test file cross checked with
gcc -c -Wall -Werror -Wno-unused-variable validation/builtin_inf.c
Signed-off-by: Michael Stefaniuc <mstefani@redhat.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
-rw-r--r-- | validation/builtin_inf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/validation/builtin_inf.c b/validation/builtin_inf.c new file mode 100644 index 00000000..48546e48 --- /dev/null +++ b/validation/builtin_inf.c @@ -0,0 +1,13 @@ +static double d = __builtin_huge_val(); +static float f = __builtin_huge_valf(); +static long double l = __builtin_huge_vall(); +static double di = __builtin_inf(); +static float fi = __builtin_inff(); +static long double li = __builtin_infl(); +static double dn = __builtin_nan(""); +static float fn = __builtin_nanf(""); +static long double ln = __builtin_nanl(""); + +/* + * check-name: __builtin INFINITY / nan() + */ |