2 ! Test implementation of the iomsg tag.
6 ! Test that iomsg is left unchanged with no error
8 open(10, status
='scratch', iomsg
=ch
, iostat
=i
)
9 if (ch
.ne
. 'asdf') STOP 1
11 ! Test iomsg with data transfer statement
12 read(10,'(I2)', iomsg
=ch
, end=100) k
15 if (ch
.ne
. 'End of file') STOP 3
17 ! Test iomsg with open
18 open (-3, err
=200, iomsg
=ch
)
22 if (ch
.ne
. 'Bad unit number in OPEN statement') STOP 5
24 ! Test iomsg with close
25 close(23,status
="no_idea", err
=500, iomsg
=ch
) ! { dg-warning "STATUS specifier in CLOSE statement.*has invalid value" }
27 if (ch
.ne
. "Bad STATUS parameter in CLOSE statement") STOP 6
28 end program iomsg_test