gcc/libgomp/testsuite/libgomp.fortran/pr34020.f90
Jakub Jelinek 78e4746337 re PR fortran/34020 (Bogus codegen for openmp atomics w/ indirects operands on IPF)
PR fortran/34020
	* gimplify.c (goa_lhs_expr_p): Inside INDIRECT_REF handle unshared
	nops.

	* testsuite/libgomp.fortran/pr34020.f90: New test.

From-SVN: r130069
2007-11-10 08:51:55 +01:00

20 lines
371 B
Fortran

! 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