RISC-V: Refactor Dynamic LMUL codes
[official-gcc.git] / gcc / testsuite / gfortran.dg / module_nan.f90
blob4b7cd9a50c5b73c55be2a7d19f71b9c5d526fab8
1 ! { dg-do run }
2 ! { dg-options "-fno-range-check" }
3 ! { dg-add-options ieee }
5 ! PR fortran/34318
7 ! Infinity and NaN were not properly written to the .mod file.
9 module nonordinal
10 implicit none
11 real, parameter :: inf = 1./0., nan = 0./0., minf = -1./0.0
12 end module nonordinal
14 program a
15 use nonordinal
16 implicit none
17 character(len=20) :: str
18 if (log(abs(inf)) < huge(inf)) STOP 1
19 if (log(abs(minf)) < huge(inf)) STOP 2
20 if (.not. isnan(nan)) STOP 3
21 write(str,"(sp,f10.2)") inf
22 if (adjustl(str) /= "+Infinity") STOP 4
23 write(str,*) minf
24 if (adjustl(str) /= "-Infinity") STOP 5
25 write(str,*) nan
26 if (adjustl(str) /= "NaN") STOP 6
27 end program a