2 ! { dg-options "-fmax-errors=1000 -fopenmp" }
7 integer, intent(in
) :: x
, y
11 subroutine sub1 (x
, y
)
12 integer, intent(in
) :: y
13 integer, intent(out
) :: x
17 integer, intent(in
) :: x
21 subroutine sub2 (x
, y
)
22 integer, intent(in
) :: y
23 integer, intent(inout
) :: x
27 integer, intent(in
) :: x(:), y(:)
28 integer :: fn3(lbound(x
, 1):ubound(x
, 1))
31 subroutine sub3 (x
, y
)
32 integer, intent(in
) :: y(:)
33 integer, intent(out
) :: x(:)
37 integer, intent(in
) :: x(:)
38 integer :: fn4(lbound(x
, 1):ubound(x
, 1))
41 subroutine sub4 (x
, y
)
42 integer, intent(in
) :: y(:)
43 integer, intent(inout
) :: x(:)
47 integer, intent(in
) :: x(10), y(10)
51 subroutine sub5 (x
, y
)
52 integer, intent(in
) :: y(10)
53 integer, intent(out
) :: x(10)
57 integer, intent(in
) :: x(10)
61 subroutine sub6 (x
, y
)
62 integer, intent(in
) :: y(10)
63 integer, intent(inout
) :: x(10)
67 integer, allocatable
, intent(in
) :: x(:), y(:)
68 integer, allocatable
:: fn7(:)
71 subroutine sub7 (x
, y
)
72 integer, allocatable
, intent(in
) :: y(:)
73 integer, allocatable
, intent(out
) :: x(:)
77 integer, allocatable
, intent(in
) :: x(:)
78 integer, allocatable
:: fn8(:)
81 subroutine sub8 (x
, y
)
82 integer, allocatable
, intent(in
) :: y(:)
83 integer, allocatable
, intent(inout
) :: x(:)
89 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
90 !$omp declare reduction (bar : integer : omp_out = fn1 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" }
91 !$omp & initializer (sub1 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" }
92 !$omp declare reduction (baz : integer : sub2 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" }
93 !$omp initializer (omp_priv = fn2 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" }
95 !$omp parallel reduction (foo : a)
97 !$omp parallel reduction (bar : a)
99 !$omp parallel reduction (baz : a)
104 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
105 !$omp declare reduction (bar : integer : omp_out = fn1 (omp_out, omp_in)) &
106 !$omp & initializer (sub1 (omp_priv, omp_orig))
107 !$omp declare reduction (baz : integer : sub2 (omp_out, omp_in)) &
108 !$omp initializer (omp_priv = fn2 (omp_orig))
110 !$omp parallel reduction (foo : a)
112 !$omp parallel reduction (bar : a)
114 !$omp parallel reduction (baz : a)
119 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
120 !$omp declare reduction (bar : integer : omp_out = fn1 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" }
121 !$omp & initializer (sub1 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" }
122 !$omp declare reduction (baz : integer : sub2 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" }
123 !$omp initializer (omp_priv = fn2 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" }
124 integer, allocatable
:: a(:)
126 !$omp parallel reduction (foo : a)
128 !$omp parallel reduction (bar : a)
130 !$omp parallel reduction (baz : a)
135 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
136 !$omp declare reduction (bar : integer : omp_out = fn1 (omp_out, omp_in)) &
137 !$omp & initializer (sub1 (omp_priv, omp_orig))
138 !$omp declare reduction (baz : integer : sub2 (omp_out, omp_in)) &
139 !$omp initializer (omp_priv = fn2 (omp_orig))
140 integer, allocatable
:: a
142 !$omp parallel reduction (foo : a)
144 !$omp parallel reduction (bar : a)
146 !$omp parallel reduction (baz : a)
151 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
152 !$omp declare reduction (bar : integer : omp_out = fn3 (omp_out, omp_in)) &
153 !$omp & initializer (sub3 (omp_priv, omp_orig))
154 !$omp declare reduction (baz : integer : sub4 (omp_out, omp_in)) &
155 !$omp initializer (omp_priv = fn4 (omp_orig))
157 !$omp parallel reduction (foo : a)
159 !$omp parallel reduction (bar : a)
161 !$omp parallel reduction (baz : a)
166 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
167 !$omp declare reduction (bar : integer : omp_out = fn3 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
168 !$omp & initializer (sub3 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
169 !$omp declare reduction (baz : integer : sub4 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
170 !$omp initializer (omp_priv = fn4 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
172 !$omp parallel reduction (foo : a)
174 !$omp parallel reduction (bar : a)
176 !$omp parallel reduction (baz : a)
181 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
182 !$omp declare reduction (bar : integer : omp_out = fn3 (omp_out, omp_in)) &
183 !$omp & initializer (sub3 (omp_priv, omp_orig))
184 !$omp declare reduction (baz : integer : sub4 (omp_out, omp_in)) &
185 !$omp initializer (omp_priv = fn4 (omp_orig))
186 integer, allocatable
:: a(:)
188 !$omp parallel reduction (foo : a)
190 !$omp parallel reduction (bar : a)
192 !$omp parallel reduction (baz : a)
197 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
198 !$omp declare reduction (bar : integer : omp_out = fn3 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
199 !$omp & initializer (sub3 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
200 !$omp declare reduction (baz : integer : sub4 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
201 !$omp initializer (omp_priv = fn4 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
202 integer, allocatable
:: a
204 !$omp parallel reduction (foo : a)
206 !$omp parallel reduction (bar : a)
208 !$omp parallel reduction (baz : a)
213 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
214 !$omp declare reduction (bar : integer : omp_out = fn5 (omp_out, omp_in)) &
215 !$omp & initializer (sub5 (omp_priv, omp_orig))
216 !$omp declare reduction (baz : integer : sub6 (omp_out, omp_in)) &
217 !$omp initializer (omp_priv = fn6 (omp_orig))
219 !$omp parallel reduction (foo : a)
221 !$omp parallel reduction (bar : a)
223 !$omp parallel reduction (baz : a)
228 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
229 !$omp declare reduction (bar : integer : omp_out = fn5 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
230 !$omp & initializer (sub5 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
231 !$omp declare reduction (baz : integer : sub6 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
232 !$omp initializer (omp_priv = fn6 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
234 !$omp parallel reduction (foo : a)
236 !$omp parallel reduction (bar : a)
238 !$omp parallel reduction (baz : a)
240 end subroutine test10
243 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
244 !$omp declare reduction (bar : integer : omp_out = fn5 (omp_out, omp_in)) &
245 !$omp & initializer (sub5 (omp_priv, omp_orig))
246 !$omp declare reduction (baz : integer : sub6 (omp_out, omp_in)) &
247 !$omp initializer (omp_priv = fn6 (omp_orig))
248 integer, allocatable
:: a(:)
250 !$omp parallel reduction (foo : a)
252 !$omp parallel reduction (bar : a)
254 !$omp parallel reduction (baz : a)
256 end subroutine test11
259 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
260 !$omp declare reduction (bar : integer : omp_out = fn5 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
261 !$omp & initializer (sub5 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
262 !$omp declare reduction (baz : integer : sub6 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
263 !$omp initializer (omp_priv = fn6 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
264 integer, allocatable
:: a
266 !$omp parallel reduction (foo : a)
268 !$omp parallel reduction (bar : a)
270 !$omp parallel reduction (baz : a)
272 end subroutine test12
275 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
276 !$omp declare reduction (bar : integer : omp_out = & ! { dg-error "Different shape for array assignment at \[^\n\r]* on dimension 1 .9 and 10" }
277 !$omp & fn5 (omp_out, omp_in)) & ! { dg-error "Actual argument contains too few elements for dummy argument \[^\n\r]* .9/10" }
278 !$omp & initializer (sub5 (omp_priv, omp_orig)) ! { dg-error "Actual argument contains too few elements for dummy argument \[^\n\r]* .9/10" }
279 !$omp declare reduction (baz : integer : sub6 (omp_out, omp_in)) & ! { dg-error "Actual argument contains too few elements for dummy argument \[^\n\r]* .9/10" }
280 !$omp initializer (omp_priv = & ! { dg-error "Different shape for array assignment at \[^\n\r]* on dimension 1 .9 and 10" }
281 !$omp & fn6 (omp_orig)) ! { dg-error "Actual argument contains too few elements for dummy argument \[^\n\r]* .9/10" }
283 !$omp parallel reduction (foo : a)
285 !$omp parallel reduction (bar : a)
287 !$omp parallel reduction (baz : a)
289 end subroutine test13
292 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
293 !$omp declare reduction (bar : integer : omp_out = fn7 (omp_out, omp_in)) & ! { dg-error "Actual argument for \[^\n\r]* must be ALLOCATABLE" }
294 !$omp & initializer (sub7 (omp_priv, omp_orig)) ! { dg-error "Actual argument for \[^\n\r]* must be ALLOCATABLE" }
295 !$omp declare reduction (baz : integer : sub8 (omp_out, omp_in)) & ! { dg-error "Actual argument for \[^\n\r]* must be ALLOCATABLE" }
296 !$omp initializer (omp_priv = fn8 (omp_orig)) ! { dg-error "Actual argument for \[^\n\r]* must be ALLOCATABLE" }
298 !$omp parallel reduction (foo : a)
300 !$omp parallel reduction (bar : a)
302 !$omp parallel reduction (baz : a)
304 end subroutine test14
307 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
308 !$omp declare reduction (bar : integer : omp_out = fn7 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
309 !$omp & initializer (sub7 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
310 !$omp declare reduction (baz : integer : sub8 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
311 !$omp initializer (omp_priv = fn8 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
313 !$omp parallel reduction (foo : a)
315 !$omp parallel reduction (bar : a)
317 !$omp parallel reduction (baz : a)
319 end subroutine test15
322 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
323 !$omp declare reduction (bar : integer : omp_out = fn7 (omp_out, omp_in)) &
324 !$omp & initializer (sub7 (omp_priv, omp_orig))
325 !$omp declare reduction (baz : integer : sub8 (omp_out, omp_in)) &
326 !$omp initializer (omp_priv = fn8 (omp_orig))
327 integer, allocatable
:: a(:)
329 !$omp parallel reduction (foo : a)
331 !$omp parallel reduction (bar : a)
333 !$omp parallel reduction (baz : a)
335 end subroutine test16
338 !$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0)
339 !$omp declare reduction (bar : integer : omp_out = fn7 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
340 !$omp & initializer (sub7 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
341 !$omp declare reduction (baz : integer : sub8 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" }
342 !$omp initializer (omp_priv = fn8 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" }
343 integer, allocatable
:: a
345 !$omp parallel reduction (foo : a)
347 !$omp parallel reduction (bar : a)
349 !$omp parallel reduction (baz : a)
351 end subroutine test17