summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.fortran/async_io_9.f90
blob: 2dc111c3967781fb29f1575d506932ee295fb4f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { 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