diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/isnan_1.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/isnan_1.f90 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/isnan_1.f90 b/gcc/testsuite/gfortran.dg/isnan_1.f90 new file mode 100644 index 000000000..89e4cd35b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/isnan_1.f90 @@ -0,0 +1,21 @@ +! Test for the ISNAN intrinsic +! +! { dg-do run } +! { dg-add-options ieee } +! { dg-skip-if "NaN not supported" { spu-*-* } { "*" } { "" } } +! + implicit none + real :: x + x = -1.0 + x = sqrt(x) + if (.not. isnan(x)) call abort + x = 0.0 + x = x / x + if (.not. isnan(x)) call abort + + x = 5.0 + if (isnan(x)) call abort + x = huge(x) + x = 2*x + if (isnan(x)) call abort +end |