blob: 3bb14f5fe3d6965b3c8b0fccc0f7d940e7210192 [file] [log] [blame]
! PR fortran/34020
! { dg-do run }
subroutine atomic_add(lhs, rhs)
real lhs, rhs
!$omp atomic
lhs = rhs + lhs
end
real lhs, rhs
integer i
lhs = 0
rhs = 1
!$omp parallel do num_threads(8) shared(lhs, rhs)
do i = 1, 300000
call atomic_add(lhs, rhs)
enddo
if (lhs .ne. 300000) call abort
end