coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray / event_3.f08
blobf6e28b78c8db602d39302bd2f2b5522e5f38de2f
1 ! { dg-do run }
3 ! Check PR fortran/70696 is fixed.
5 program global_event
6   use iso_fortran_env , only : event_type
7   implicit none
8   type(event_type) :: x[*]
9   
10   call exchange
11   contains
12     subroutine exchange
13       integer :: cnt
14       event post(x[1])
15       event post(x[1])
16       call event_query(x, cnt)
17       if (cnt /= 2) error stop 1
18       event wait(x, until_count=2)
19     end subroutine
20 end