| 1 |
! { dg-do run } |
| 2 |
! Verify that when decimal precision is zero, error error given except with 1P. |
| 3 |
! Submitted by Jerry DeLisle <[email protected]> |
| 4 |
! Modified for fix to PR35036 |
| 5 |
program test |
| 6 |
implicit none |
| 7 |
character(20) :: astr |
| 8 |
integer :: istat |
| 9 |
50 FORMAT (1PD20.0) |
| 10 |
astr = "" |
| 11 |
write(astr,50) -8.0D0 |
| 12 |
if (astr.ne." -8.D+00") STOP 1 |
| 13 |
write(astr,50) 8.0D0 |
| 14 |
if (astr.ne." 8.D+00") STOP 2 |
| 15 |
write(astr, '(E15.0)', iostat=istat) 1e5 |
| 16 |
if (istat /= 5006) STOP 3 |
| 17 |
write(astr, '(D15.0)', iostat=istat) 1e5 |
| 18 |
if (istat /= 5006) STOP 4 |
| 19 |
write(astr, '(G15.0)', iostat=istat) 1e5 |
| 20 |
if (istat /= 5006) STOP 5 |
| 21 |
write(astr, '(2PE15.0)', iostat=istat) 1e5 |
| 22 |
if (istat /= 5006) STOP 6 |
| 23 |
write(astr, '(0PE15.0)', iostat=istat) 1e5 |
| 24 |
if (istat /= 5006) STOP 7 |
| 25 |
write(astr, '(1PE15.0)', iostat=istat) 1e5 |
| 26 |
if (istat /= 0) STOP 8 |
| 27 |
write(astr, '(F15.0)', iostat=istat) 1e5 |
| 28 |
if (astr.ne." 100000.") STOP 9 |
| 29 |
if (istat /= 0) STOP 10 |
| 30 |
end program test |