Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / read_infnan_1.f90
blob97f82674c6b60ea2cb0b392e453ee7ff8c48d502
1 ! { dg-do run }
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>
9 program pr43298
10 real(4) :: x4(7)
11 real(8) :: x8(7)
12 character(80) :: output
14 open(10, status='scratch')
15 ! 0123456789012345678901234567890123456789012345678901234567890123456789
16 write(10,'(a)') "inf nan infinity NaN(dx) -INf NAN InFiNiTy"
17 rewind(10)
18 x4 = 0.0_4
19 x8 = 0.0_8
20 read(10,'(7f10.3)') x4
21 rewind(10)
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
29 end program pr43298