reference-reductions.f90 963 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ! Test reductions on dummy arguments inside modules.
  2. ! { dg-do run }
  3. ! { dg-additional-options -Wuninitialized }
  4. module prm
  5. implicit none
  6. contains
  7. subroutine param_reduction(var)
  8. implicit none
  9. integer(kind=8) :: var
  10. integer :: j,k
  11. !$acc parallel copy(var)
  12. !$acc loop reduction(+ : var) gang
  13. ! { dg-bogus {'var\.[0-9]+' is used uninitialized} TODO { xfail *-*-* } .-1 }
  14. ! { dg-note {'var\.[0-9]+' was declared here} {} { target *-*-* } .-2 }
  15. do k=1,10
  16. !$acc loop vector reduction(+ : var)
  17. ! { dg-bogus {'var\.[0-9]+' may be used uninitialized} TODO { xfail { ! __OPTIMIZE__ } } .-1 }
  18. ! { dg-note {'var\.[0-9]+' was declared here} {} { target { ! __OPTIMIZE__ } } .-2 }
  19. do j=1,100
  20. var = var + 1.0
  21. enddo
  22. enddo
  23. !$acc end parallel
  24. end subroutine param_reduction
  25. end module prm
  26. program test
  27. use prm
  28. implicit none
  29. integer(8) :: r
  30. r=10.0
  31. call param_reduction (r)
  32. if (r .ne. 1010) stop 1
  33. end program test