Debian Codegraph @

gcc/testsuite/gfortran.dg/goacc/array-reduction.f90

raw
1 program 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 !$acc serial reduction (+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
30 do i = 1, 10
31 a = a + 1
32 end do
33 !$acc end serial
34
35 !$acc serial
36 !$acc loop reduction (+:a) ! { dg-error "Array 'a' is not permitted in reduction" }
37 do i = 1, 10
38 a = a + 1
39 end do
40 !$acc end serial
41
42
43 ! Subarray reductions.
44
45 !$acc parallel 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 parallel
50
51 !$acc parallel
52 !$acc loop reduction (+:a(1:5)) ! { dg-error "Array 'a' is not permitted in reduction" }
53 do i = 1, 10
54 a = a + 1
55 end do
56 !$acc end parallel
57
58 !$acc kernels
59 !$acc loop reduction (+:a(1:5)) ! { dg-error "Array 'a' is not permitted in reduction" }
60 do i = 1, 10
61 a = a + 1
62 end do
63 !$acc end kernels
64
65 !$acc serial reduction (+:a(1:5)) ! { dg-error "Array 'a' is not permitted in reduction" }
66 do i = 1, 10
67 a = a + 1
68 end do
69 !$acc end serial
70
71 !$acc serial
72 !$acc loop reduction (+:a(1:5)) ! { dg-error "Array 'a' is not permitted in reduction" }
73 do i = 1, 10
74 a = a + 1
75 end do
76 !$acc end serial
77
78
79 ! Reductions on array elements.
80
81 !$acc parallel reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
82 do i = 1, 10
83 a(1) = a(1) + 1
84 end do
85 !$acc end parallel
86
87 !$acc parallel
88 !$acc loop reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
89 do i = 1, 10
90 a(1) = a(1) + 1
91 end do
92 !$acc end parallel
93
94 !$acc kernels
95 !$acc loop reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
96 do i = 1, 10
97 a(1) = a(1) + 1
98 end do
99 !$acc end kernels
100
101 !$acc serial reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
102 do i = 1, 10
103 a(1) = a(1) + 1
104 end do
105 !$acc end serial
106
107 !$acc serial
108 !$acc loop reduction (+:a(1)) ! { dg-error "Array 'a' is not permitted in reduction" }
109 do i = 1, 10
110 a(1) = a(1) + 1
111 end do
112 !$acc end serial
113
114
115 print *, a
116 end program test