| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! PR fortran/18918 |
| 4 |
! |
| 5 |
! Basic atomic def/ref test |
| 6 |
! |
| 7 |
|
| 8 |
use iso_fortran_env, only: atomic_int_kind, atomic_logical_kind |
| 9 |
implicit none |
| 10 |
integer(atomic_int_kind) :: a(1)[*] |
| 11 |
logical(atomic_logical_kind) :: c[*] |
| 12 |
intrinsic :: atomic_define |
| 13 |
intrinsic :: atomic_ref |
| 14 |
integer(8) :: b |
| 15 |
logical(1) :: d |
| 16 |
|
| 17 |
call atomic_define(a(1), 7_2) |
| 18 |
call atomic_ref(b, a(1)) |
| 19 |
if (b /= a(1)) STOP 1 |
| 20 |
|
| 21 |
call atomic_define(c, .false.) |
| 22 |
call atomic_ref(d, c[this_image()]) |
| 23 |
if (d .neqv. .false.) STOP 2 |
| 24 |
call atomic_define(c[this_image()], .true.) |
| 25 |
call atomic_ref(d, c) |
| 26 |
if (d .neqv. .true.) STOP 3 |
| 27 |
end |