1program test
2  implicit none
3  integer a(10), i
4
5  a(:) = 0
6
7  ! Array reductions.
8
9  !$acc parallel reduction (+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
10  do i = 1, 10
11     a = a + 1
12  end do
13  !$acc end parallel
14
15  !$acc parallel
16  !$acc loop reduction (+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
17  do i = 1, 10
18     a = a + 1
19  end do
20  !$acc end parallel
21
22  !$acc kernels
23  !$acc loop reduction (+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
24  do i = 1, 10
25     a = a + 1
26  end do
27  !$acc end kernels
28
29  ! Subarray reductions.
30
31  !$acc parallel reduction (+:a(1:5)) ! { dg-error "Array 'a' is not permitted in reduction" }
32  do i = 1, 10
33     a = a + 1
34  end do
35  !$acc end parallel
36
37  !$acc parallel
38  !$acc loop reduction (+:a(1:5)) ! { dg-error "Array 'a' is not permitted in reduction" }
39  do i = 1, 10
40     a = a + 1
41  end do
42  !$acc end parallel
43
44  !$acc kernels
45  !$acc loop reduction (+:a(1:5)) ! { dg-error "Array 'a' is not permitted in reduction" }
46  do i = 1, 10
47     a = a + 1
48  end do
49  !$acc end kernels
50
51  ! Reductions on array elements.
52
53  !$acc parallel reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
54  do i = 1, 10
55     a(1) = a(1) + 1
56  end do
57  !$acc end parallel
58
59  !$acc parallel
60  !$acc loop reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
61  do i = 1, 10
62     a(1) = a(1) + 1
63  end do
64  !$acc end parallel
65
66  !$acc kernels
67  !$acc loop reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
68  do i = 1, 10
69     a(1) = a(1) + 1
70  end do
71  !$acc end kernels
72
73  print *, a
74end program test
75