pr29629.f90 423 B

123456789101112131415161718192021
  1. ! PR fortran/29629
  2. ! { dg-do run }
  3. program pr29629
  4. integer :: n
  5. n = 10000
  6. if (any (func(n).ne.10000)) call abort
  7. contains
  8. function func(n)
  9. integer, intent(in) :: n
  10. integer, dimension(n) :: func
  11. integer :: k
  12. func = 0
  13. !$omp parallel do private(k), reduction(+:func), num_threads(4)
  14. do k = 1, n
  15. func = func + 1
  16. end do
  17. !$omp end parallel do
  18. end function
  19. end program