2 ! { dg-add-options ieee }
4 ! PR43298 Fortran library does not read in NaN, NaN(), -Inf, or Inf
6 ! Formatted READ part of PR fortran/43298
8 ! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
12 character(80) :: output
14 open(10, status
='scratch')
15 ! 0123456789012345678901234567890123456789012345678901234567890123456789
16 write(10,'(a)') "inf nan infinity NaN(dx) -INf NAN InFiNiTy"
20 read(10,'(7f10.3)') x4
22 read(10,'(7f10.3)') x8
23 write (output
, '("x4 =",7G6.0)') x4
24 if (output
.ne
."x4 = Inf NaN Inf NaN -Inf NaN Inf") STOP 1
25 write (output
, '("x8 =",7G6.0)') x8
26 if (output
.ne
."x8 = Inf NaN Inf NaN -Inf NaN Inf") STOP 2
27 !print '("x4 =",7G6.0)', x4
28 !print '("x8 =",7G6.0)', x8