aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/isnan_1.f90
blob: 47187432bf278725f99f177c045001087a2f8394 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! Test for the ISNAN intrinsic
!
! { dg-do run }
! { dg-options "-pedantic-errors -mieee" { target alpha*-*-* sh*-*-* } }
! { 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