2 /* { dg-options "-O2 -fopenmp" } */
5 extern void abort (void);
10 test1 (long j1
, long k1
, long j2
, long k2
)
13 #pragma omp parallel reduction (+:e,c)
15 #pragma omp for schedule (static)
16 for (i
= j1
; i
<= k1
; ++i
)
25 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
30 test2 (long j1
, long k1
, long j2
, long k2
)
33 #pragma omp parallel reduction (+:e,c)
35 #pragma omp for schedule (static)
36 for (i
= k1
; i
>= j1
; --i
)
45 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
50 test3 (long j1
, long k1
, long j2
, long k2
)
53 #pragma omp parallel reduction (+:e,c)
55 #pragma omp for schedule (static, 1)
56 for (i
= j1
; i
<= k1
; ++i
)
65 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
70 test4 (long j1
, long k1
, long j2
, long k2
)
73 #pragma omp parallel reduction (+:e,c)
75 #pragma omp for schedule (static, 1)
76 for (i
= k1
; i
>= j1
; --i
)
85 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
90 test5 (long j1
, long k1
, long j2
, long k2
)
93 #pragma omp parallel reduction (+:e,c)
95 #pragma omp for schedule (static) ordered
96 for (i
= j1
; i
<= k1
; ++i
)
106 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
111 test6 (long j1
, long k1
, long j2
, long k2
)
113 long i
, e
= 0, c
= 0;
114 #pragma omp parallel reduction (+:e,c)
116 #pragma omp for schedule (static) ordered
117 for (i
= k1
; i
>= j1
; --i
)
119 if (i
< j2
|| i
> k2
)
127 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
132 test7 (long j1
, long k1
, long j2
, long k2
)
134 long i
, e
= 0, c
= 0;
135 #pragma omp parallel reduction (+:e,c)
137 #pragma omp for schedule (static, 1) ordered
138 for (i
= j1
; i
<= k1
; ++i
)
140 if (i
< j2
|| i
> k2
)
148 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
153 test8 (long j1
, long k1
, long j2
, long k2
)
155 long i
, e
= 0, c
= 0;
156 #pragma omp parallel reduction (+:e,c)
158 #pragma omp for schedule (static, 1) ordered
159 for (i
= k1
; i
>= j1
; --i
)
161 if (i
< j2
|| i
> k2
)
169 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
174 test9 (long j1
, long k1
, long j2
, long k2
)
176 long i
, e
= 0, c
= 0;
177 #pragma omp parallel for reduction (+:e,c) schedule (static)
178 for (i
= j1
; i
<= k1
; ++i
)
180 if (i
< j2
|| i
> k2
)
184 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
189 test10 (long j1
, long k1
, long j2
, long k2
)
191 long i
, e
= 0, c
= 0;
192 #pragma omp parallel for reduction (+:e,c) schedule (static)
193 for (i
= k1
; i
>= j1
; --i
)
195 if (i
< j2
|| i
> k2
)
199 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
204 test11 (long j1
, long k1
, long j2
, long k2
)
206 long i
, e
= 0, c
= 0;
207 #pragma omp parallel for reduction (+:e,c) schedule (static, 1)
208 for (i
= j1
; i
<= k1
; ++i
)
210 if (i
< j2
|| i
> k2
)
214 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
219 test12 (long j1
, long k1
, long j2
, long k2
)
221 long i
, e
= 0, c
= 0;
222 #pragma omp parallel for reduction (+:e,c) schedule (static, 1)
223 for (i
= k1
; i
>= j1
; --i
)
225 if (i
< j2
|| i
> k2
)
229 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
234 test13 (long j1
, long k1
, long j2
, long k2
)
236 long i
, e
= 0, c
= 0;
237 #pragma omp parallel for reduction (+:e,c) schedule (static) ordered
238 for (i
= j1
; i
<= k1
; ++i
)
240 if (i
< j2
|| i
> k2
)
245 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
250 test14 (long j1
, long k1
, long j2
, long k2
)
252 long i
, e
= 0, c
= 0;
253 #pragma omp parallel for reduction (+:e,c) schedule (static) ordered
254 for (i
= k1
; i
>= j1
; --i
)
256 if (i
< j2
|| i
> k2
)
261 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
266 test15 (long j1
, long k1
, long j2
, long k2
)
268 long i
, e
= 0, c
= 0;
269 #pragma omp parallel for reduction (+:e,c) schedule (static, 1) ordered
270 for (i
= j1
; i
<= k1
; ++i
)
272 if (i
< j2
|| i
> k2
)
277 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
282 test16 (long j1
, long k1
, long j2
, long k2
)
284 long i
, e
= 0, c
= 0;
285 #pragma omp parallel for reduction (+:e,c) schedule (static, 1) ordered
286 for (i
= k1
; i
>= j1
; --i
)
288 if (i
< j2
|| i
> k2
)
293 if (e
|| (c
!= j2
> k2
? 0 : k2
- j2
+ 1))
298 __attribute__((noinline
))
299 test (long j1
, long k1
, long j2
, long k2
)
301 test1 (j1
, k1
, j2
, k2
);
302 test2 (j1
, k1
, j2
, k2
);
303 test3 (j1
, k1
, j2
, k2
);
304 test4 (j1
, k1
, j2
, k2
);
305 test5 (j1
, k1
, j2
, k2
);
306 test6 (j1
, k1
, j2
, k2
);
307 test7 (j1
, k1
, j2
, k2
);
308 test8 (j1
, k1
, j2
, k2
);
309 test9 (j1
, k1
, j2
, k2
);
310 test10 (j1
, k1
, j2
, k2
);
311 test11 (j1
, k1
, j2
, k2
);
312 test12 (j1
, k1
, j2
, k2
);
313 test13 (j1
, k1
, j2
, k2
);
314 test14 (j1
, k1
, j2
, k2
);
315 test15 (j1
, k1
, j2
, k2
);
316 test16 (j1
, k1
, j2
, k2
);