1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC reduction validity.
5 program openacc_reduction_validity
13 !$acc parallel reduction(+:i)
16 !$acc parallel reduction(*:i)
19 !$acc parallel reduction(min:i)
22 !$acc parallel reduction(max:i)
25 !$acc parallel reduction(iand:i)
28 !$acc parallel reduction(ior:i)
31 !$acc parallel reduction(ieor:i)
34 !ERROR: reduction operator not supported for integer type
35 !$acc parallel reduction(.and.:i)
38 !ERROR: reduction operator not supported for integer type
39 !$acc parallel reduction(.or.:i)
42 !ERROR: reduction operator not supported for integer type
43 !$acc parallel reduction(.eqv.:i)
46 !ERROR: reduction operator not supported for integer type
47 !$acc parallel reduction(.neqv.:i)
50 !$acc parallel reduction(+:r)
53 !$acc parallel reduction(*:r)
56 !$acc parallel reduction(min:r)
59 !$acc parallel reduction(max:r)
62 !ERROR: reduction operator not supported for real type
63 !$acc parallel reduction(iand:r)
66 !ERROR: reduction operator not supported for real type
67 !$acc parallel reduction(ior:r)
70 !ERROR: reduction operator not supported for real type
71 !$acc parallel reduction(ieor:r)
74 !ERROR: reduction operator not supported for real type
75 !$acc parallel reduction(.and.:r)
78 !ERROR: reduction operator not supported for real type
79 !$acc parallel reduction(.or.:r)
82 !ERROR: reduction operator not supported for real type
83 !$acc parallel reduction(.eqv.:r)
86 !ERROR: reduction operator not supported for real type
87 !$acc parallel reduction(.neqv.:r)
90 !$acc parallel reduction(+:c)
93 !$acc parallel reduction(*:c)
96 !ERROR: reduction operator not supported for complex type
97 !$acc parallel reduction(min:c)
100 !ERROR: reduction operator not supported for complex type
101 !$acc parallel reduction(max:c)
104 !ERROR: reduction operator not supported for complex type
105 !$acc parallel reduction(iand:c)
108 !ERROR: reduction operator not supported for complex type
109 !$acc parallel reduction(ior:c)
112 !ERROR: reduction operator not supported for complex type
113 !$acc parallel reduction(ieor:c)
116 !ERROR: reduction operator not supported for complex type
117 !$acc parallel reduction(.and.:c)
120 !ERROR: reduction operator not supported for complex type
121 !$acc parallel reduction(.or.:c)
124 !ERROR: reduction operator not supported for complex type
125 !$acc parallel reduction(.eqv.:c)
128 !ERROR: reduction operator not supported for complex type
129 !$acc parallel reduction(.neqv.:c)
132 !$acc parallel reduction(.and.:l)
135 !$acc parallel reduction(.or.:l)
138 !$acc parallel reduction(.eqv.:l)
141 !$acc parallel reduction(.neqv.:l)
144 !ERROR: reduction operator not supported for logical type
145 !$acc parallel reduction(+:l)
148 !ERROR: reduction operator not supported for logical type
149 !$acc parallel reduction(*:l)
152 !ERROR: reduction operator not supported for logical type
153 !$acc parallel reduction(min:l)
156 !ERROR: reduction operator not supported for logical type
157 !$acc parallel reduction(max:l)
160 !ERROR: reduction operator not supported for logical type
161 !$acc parallel reduction(iand:l)
164 !ERROR: reduction operator not supported for logical type
165 !$acc parallel reduction(ior:l)
168 !ERROR: reduction operator not supported for logical type
169 !$acc parallel reduction(ieor:l)
172 !ERROR: No explicit type declared for 'xyz'
173 !$acc parallel reduction(+:xyz)