8df7ee67f6
gcc/fortran/ChangeLog: 2020-05-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/95191 * libgfortran.h (libgfortran_error_codes): Add LIBERROR_BAD_WAIT_ID. libgfortran/ChangeLog: 2020-05-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/95191 * io/async.c (async_wait_id): Generate error if ID is higher than the highest current ID. * runtime/error.c (translate_error): Handle LIBERROR_BAD_WAIT_ID. libgomp/ChangeLog: 2020-05-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/95191 * testsuite/libgomp.fortran/async_io_9.f90: New test.
21 lines
578 B
Fortran
21 lines
578 B
Fortran
! { dg-do run }
|
|
! PR 95191 - this used to hang.
|
|
! Original test case by Bill Long.
|
|
program test
|
|
real a(10000)
|
|
integer my_id
|
|
integer bad_id
|
|
integer :: iostat
|
|
character (len=100) :: iomsg
|
|
data my_id /1/
|
|
data bad_id /2/
|
|
a = 1.
|
|
open (unit=10, file='test.dat', form='unformatted', &
|
|
& asynchronous='yes')
|
|
write (unit=10, asynchronous='yes', id=my_id) a
|
|
iomsg = ""
|
|
wait (unit=10, id=bad_id, iostat=iostat, iomsg=iomsg)
|
|
if (iostat == 0 .or. iomsg /= "Bad ID in WAIT statement") stop 1
|
|
close (unit=10, status='delete')
|
|
end program test
|