diff options
author | Richard Henderson <rth@gcc.gnu.org> | 2002-09-07 19:15:27 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-09-07 19:15:27 -0700 |
commit | ff6c6aa895e907dc592e3347479c95da450d8040 (patch) | |
tree | 94ac34a45eea3b6e27b123de541e8e6b775eea56 | |
parent | 5c102b484adc71da720b768b8f96386d23974a8f (diff) | |
download | gcc-ff6c6aa895e907dc592e3347479c95da450d8040.zip gcc-ff6c6aa895e907dc592e3347479c95da450d8040.tar.gz gcc-ff6c6aa895e907dc592e3347479c95da450d8040.tar.bz2 |
New tests.
From-SVN: r56924
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/ieee/inf-1.c | 35 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/builtin-inf-1.c | 13 |
2 files changed, 48 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/inf-1.c b/gcc/testsuite/gcc.c-torture/execute/ieee/inf-1.c new file mode 100644 index 0000000..34f60f3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/inf-1.c @@ -0,0 +1,35 @@ +extern void abort (void); + +int main() +{ + float fi = __builtin_inff(); + double di = __builtin_inf(); + long double li = __builtin_infl(); + + float fh = __builtin_huge_valf(); + double dh = __builtin_huge_val(); + long double lh = __builtin_huge_vall(); + + if (fi + fi != fi) + abort (); + if (di + di != di) + abort (); + if (li + li != li) + abort (); + + if (fi != fh) + abort (); + if (di != dh) + abort (); + if (li != lh) + abort (); + + if (fi <= 0) + abort (); + if (di <= 0) + abort (); + if (li <= 0) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/builtin-inf-1.c b/gcc/testsuite/gcc.dg/builtin-inf-1.c new file mode 100644 index 0000000..ca235ad --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-inf-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ + +float fi = __builtin_inff(); +double di = __builtin_inf(); +long double li = __builtin_infl(); + +float fh = __builtin_huge_valf(); +double dh = __builtin_huge_val(); +long double lh = __builtin_huge_vall(); + +/* { dg-warning "does not support infinity" "INF unsupported" { target vax-*-* i370-*-* c4x-*-* } 3 } */ +/* { dg-warning "does not support infinity" "INF unsupported" { target vax-*-* i370-*-* c4x-*-* } 4 } */ +/* { dg-warning "does not support infinity" "INF unsupported" { target vax-*-* i370-*-* c4x-*-* } 5 } */ |