diff --git a/gcc/testsuite/gfortran.dg/pr114304.f90 b/gcc/testsuite/gfortran.dg/pr114304.f90 index 8344a9ea857..2bcf9bc7f57 100644 --- a/gcc/testsuite/gfortran.dg/pr114304.f90 +++ b/gcc/testsuite/gfortran.dg/pr114304.f90 @@ -70,7 +70,25 @@ call t(.true., 'point', '4,4 ,', .true.) call t(.true., 'comma', '4;4 ;', .true.) call t(.true., 'point', '4,4 ;', .true.) + + call t2('comma', ',2') + call t2('point', '.2') + call t2('comma', ',2;') + call t2('point', '.2,') + call t2('comma', ',2 ,') + call t2('point', '.2 .') contains +subroutine t2(dec, testinput) + character(*) :: dec, testinput + integer ios + real :: r + r = 42 + read(testinput,*,decimal=dec,iostat=ios) r + if (ios /= 0 .or. abs(r - 0.2) > epsilon(r)) then + print '(*(g0))', dec, ', testinput = "',testinput,'"',', r=',r,' ios=',ios + stop 3 + end if +end subroutine t(valid, dec, testinput, isreal) logical, value :: valid character(len=*) :: dec, testinput