2 ! { dg-options "-fcoarray=single" }
4 ! Contributed by Reinhold Bader
9 use, intrinsic :: iso_fortran_env
12 integer(kind
=atomic_int_kind
) :: ia
= 0
13 logical(kind
=atomic_logical_kind
) :: la
= .false
.
19 logical :: lval
= .false
.
21 if (this_image() == 1) then
22 call atomic_define(a
[num_images()]%ia
, 4)
23 call atomic_define(a
[num_images()]%la
, .true
.)
25 if (this_image() == num_images()) then
26 do while (ival
== 0 .or
. .not
. lval
)
27 call atomic_ref(ival
, a
%ia
)
28 call atomic_ref(lval
, a
%la
)
30 if (ival
== 4 .and
. lval
) then
33 write(*,*) 'FAIL: ival,lval =', ival
, lval