| 1 |
! { dg-do run } |
| 2 |
! { dg-options "-std=gnu" } |
| 3 |
! PR38439 I/O PD edit descriptor inconsistency |
| 4 |
! Test case prepared by Jerry DeLisle <[email protected]> |
| 5 |
character(len=25) :: str |
| 6 |
character(len=132) :: msg, line |
| 7 |
str = '(1pd24.15,e6)' |
| 8 |
line = "initial string" |
| 9 |
x = 555.25 |
| 10 |
|
| 11 |
write (line,str,iostat=istat, iomsg=msg) 1.0d0, 1.234 |
| 12 |
if (istat.ne.5006 .or. msg(1:15).ne."Period required") STOP 1 |
| 13 |
if (line.ne."initial string") STOP 2 |
| 14 |
|
| 15 |
str = '(1pf0.15)' |
| 16 |
write (line,str,iostat=istat, iomsg=msg) 1.0d0 |
| 17 |
if (istat.ne.0) STOP 3 |
| 18 |
read (*,str,iostat=istat, iomsg=msg) x |
| 19 |
if (istat.ne.5006 .or. msg(1:10).ne."Zero width") STOP 4 |
| 20 |
if (x.ne.555.25) STOP 5 |
| 21 |
|
| 22 |
write (line,'(1pd24.15,e11.3)') 1.0d0, 1.234 |
| 23 |
if (line.ne." 1.000000000000000D+00 1.234E+00") STOP 6 |
| 24 |
|
| 25 |
str = '(1p2d24.15)' |
| 26 |
msg = " 1.000000000000000D+00 1.233999967575073D+00That's it!" |
| 27 |
write (line,'(1p2d24.15,a)') 1.0d0, 1.234, "That's it!" |
| 28 |
if (line.ne.msg) print *, msg |
| 29 |
end |