view gcc/testsuite/gfortran.dg/isnan_1.f90 @ 127:4c56639505ff

fix function.c and add CbC-example Makefile
author mir3636
date Wed, 11 Apr 2018 18:46:58 +0900
parents 04ced10e8804
children 84e7813d76e9
line wrap: on
line source

! 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