mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-23 10:31:22 +00:00
21 lines
393 B
Fortran
21 lines
393 B
Fortran
! PR fortran/34020
|
|
! { dg-do run }
|
|
|
|
subroutine atomic_add(lhs, rhs)
|
|
real lhs, rhs
|
|
!$omp atomic
|
|
lhs = rhs + lhs
|
|
end
|
|
|
|
external atomic_add
|
|
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) STOP 1
|
|
end
|