Retro68/gcc/libgomp/testsuite/libgomp.oacc-fortran/atomic_rw-1.f90
2018-12-28 16:30:48 +01:00

30 lines
353 B
Fortran

! { dg-do run }
program main
integer v1, v2
integer x
x = 99
!$acc parallel copy (v1, v2, x)
!$acc atomic read
v1 = x;
!$acc end atomic
!$acc atomic write
x = 32;
!$acc end atomic
!$acc atomic read
v2 = x;
!$acc end atomic
!$acc end parallel
if (v1 .ne. 99) STOP 1
if (v2 .ne. 32) STOP 2
end program main