1! { dg-do compile }
2
3program reduction
4  integer, parameter    :: n = 40, c = 10
5  integer               :: i, sum
6
7  call redsub (sum, n, c)
8end program reduction
9
10subroutine redsub(sum, n, c)
11  integer :: sum, n, c
12
13  sum = 0
14
15  !$acc parallel vector_length(n) copyin (n, c)
16  !$acc loop reduction(+:sum)
17  do i = 1, n
18     sum = sum + c
19  end do
20  !$acc end parallel
21end subroutine redsub
22