[AArch64] Fix brackets warning in assert. NFC
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-reduction-validity.f90
blobcecc7e0f507b25cb0e32a02ff3d00ca15185385b
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC reduction validity.
5 program openacc_reduction_validity
6 implicit none
8 integer :: i
9 real :: r
10 complex :: c
11 logical :: l
13 !$acc parallel reduction(+:i)
14 !$acc end parallel
16 !$acc parallel reduction(*:i)
17 !$acc end parallel
19 !$acc parallel reduction(min:i)
20 !$acc end parallel
22 !$acc parallel reduction(max:i)
23 !$acc end parallel
25 !$acc parallel reduction(iand:i)
26 !$acc end parallel
28 !$acc parallel reduction(ior:i)
29 !$acc end parallel
31 !$acc parallel reduction(ieor:i)
32 !$acc end parallel
34 !ERROR: reduction operator not supported for integer type
35 !$acc parallel reduction(.and.:i)
36 !$acc end parallel
38 !ERROR: reduction operator not supported for integer type
39 !$acc parallel reduction(.or.:i)
40 !$acc end parallel
42 !ERROR: reduction operator not supported for integer type
43 !$acc parallel reduction(.eqv.:i)
44 !$acc end parallel
46 !ERROR: reduction operator not supported for integer type
47 !$acc parallel reduction(.neqv.:i)
48 !$acc end parallel
50 !$acc parallel reduction(+:r)
51 !$acc end parallel
53 !$acc parallel reduction(*:r)
54 !$acc end parallel
56 !$acc parallel reduction(min:r)
57 !$acc end parallel
59 !$acc parallel reduction(max:r)
60 !$acc end parallel
62 !ERROR: reduction operator not supported for real type
63 !$acc parallel reduction(iand:r)
64 !$acc end parallel
66 !ERROR: reduction operator not supported for real type
67 !$acc parallel reduction(ior:r)
68 !$acc end parallel
70 !ERROR: reduction operator not supported for real type
71 !$acc parallel reduction(ieor:r)
72 !$acc end parallel
74 !ERROR: reduction operator not supported for real type
75 !$acc parallel reduction(.and.:r)
76 !$acc end parallel
78 !ERROR: reduction operator not supported for real type
79 !$acc parallel reduction(.or.:r)
80 !$acc end parallel
82 !ERROR: reduction operator not supported for real type
83 !$acc parallel reduction(.eqv.:r)
84 !$acc end parallel
86 !ERROR: reduction operator not supported for real type
87 !$acc parallel reduction(.neqv.:r)
88 !$acc end parallel
90 !$acc parallel reduction(+:c)
91 !$acc end parallel
93 !$acc parallel reduction(*:c)
94 !$acc end parallel
96 !ERROR: reduction operator not supported for complex type
97 !$acc parallel reduction(min:c)
98 !$acc end parallel
100 !ERROR: reduction operator not supported for complex type
101 !$acc parallel reduction(max:c)
102 !$acc end parallel
104 !ERROR: reduction operator not supported for complex type
105 !$acc parallel reduction(iand:c)
106 !$acc end parallel
108 !ERROR: reduction operator not supported for complex type
109 !$acc parallel reduction(ior:c)
110 !$acc end parallel
112 !ERROR: reduction operator not supported for complex type
113 !$acc parallel reduction(ieor:c)
114 !$acc end parallel
116 !ERROR: reduction operator not supported for complex type
117 !$acc parallel reduction(.and.:c)
118 !$acc end parallel
120 !ERROR: reduction operator not supported for complex type
121 !$acc parallel reduction(.or.:c)
122 !$acc end parallel
124 !ERROR: reduction operator not supported for complex type
125 !$acc parallel reduction(.eqv.:c)
126 !$acc end parallel
128 !ERROR: reduction operator not supported for complex type
129 !$acc parallel reduction(.neqv.:c)
130 !$acc end parallel
132 !$acc parallel reduction(.and.:l)
133 !$acc end parallel
135 !$acc parallel reduction(.or.:l)
136 !$acc end parallel
138 !$acc parallel reduction(.eqv.:l)
139 !$acc end parallel
141 !$acc parallel reduction(.neqv.:l)
142 !$acc end parallel
144 !ERROR: reduction operator not supported for logical type
145 !$acc parallel reduction(+:l)
146 !$acc end parallel
148 !ERROR: reduction operator not supported for logical type
149 !$acc parallel reduction(*:l)
150 !$acc end parallel
152 !ERROR: reduction operator not supported for logical type
153 !$acc parallel reduction(min:l)
154 !$acc end parallel
156 !ERROR: reduction operator not supported for logical type
157 !$acc parallel reduction(max:l)
158 !$acc end parallel
160 !ERROR: reduction operator not supported for logical type
161 !$acc parallel reduction(iand:l)
162 !$acc end parallel
164 !ERROR: reduction operator not supported for logical type
165 !$acc parallel reduction(ior:l)
166 !$acc end parallel
168 !ERROR: reduction operator not supported for logical type
169 !$acc parallel reduction(ieor:l)
170 !$acc end parallel
172 !ERROR: No explicit type declared for 'xyz'
173 !$acc parallel reduction(+:xyz)
174 !$acc end parallel
177 end program