2 /* { dg-options "-O0 -fopenmp-simd" } */
6 #define ASSERT_EQ(var, val) \
11 fprintf (stderr, "%s:%d: Unexpected value %d, expected %d\n", \
12 __FILE__, __LINE__, (var), (val)); \
23 #pragma omp tile sizes(3)
24 for (i
= 0; i
< 10; i
= i
+ 2)
39 #pragma omp tile sizes(3)
40 for (i
= 0; i
< 10; i
= i
+ 2)
55 #pragma omp tile sizes(8)
56 for (i
= 0; i
< 10; i
= i
+ 2)
71 #pragma omp tile sizes(8)
72 for (i
= 10; i
> 0; i
= i
- 2)
86 #pragma omp tile sizes(71)
87 for (i
= 10; i
> 0; i
= i
- 2)
102 #pragma omp tile sizes(1)
103 for (i
= 10; i
> 0; i
= i
- 2)
117 #pragma omp tile sizes(2)
118 for (i
= 5; i
< -5; i
= i
- 3)
120 fprintf (stderr
, "%d\n", i
);
125 /* No iteration expected */
134 #pragma omp tile sizes(2)
135 for (i
= 5; i
> -5; i
= i
- 3)
138 /* Expect only first iteration of the last tile to execute */
153 #pragma omp tile sizes(5)
154 for (i
= 5; i
>= -5; i
= i
- 4)
157 /* Expect only first iteration of the last tile to execute */
171 #pragma omp tile sizes(5)
172 for (i
= 5; i
>= -5; i
--)
187 #pragma omp tile sizes(15)
188 for (i
= 5; i
!= -5; i
--)
202 #pragma omp tile sizes(3)
203 for (i
= 0; i
!= 5; i
++)
217 long long unsigned int i
= 42;
218 #pragma omp tile sizes(15)
219 for (int i
= -5; i
< 5; i
= i
+ 3)
230 test14 (unsigned init
, int step
)
233 long long unsigned int i
;
234 #pragma omp tile sizes(8)
235 for (i
= init
; i
< 2 * init
; i
= i
+ step
)
239 ASSERT_EQ (i
, 2 * init
+ (init
== 5));
244 test15 (unsigned init
, int step
)
248 #pragma omp tile sizes(8)
249 for (unsigned i
= init
; i
> 2 * init
; i
= i
+ step
)
260 last_iter
= test1 ();
261 ASSERT_EQ (last_iter
, 10);
263 last_iter
= test2 ();
264 ASSERT_EQ (last_iter
, 10);
266 last_iter
= test3 ();
267 ASSERT_EQ (last_iter
, 10);
269 last_iter
= test4 ();
270 ASSERT_EQ (last_iter
, 0);
272 last_iter
= test5 ();
273 ASSERT_EQ (last_iter
, 0);
275 last_iter
= test6 ();
276 ASSERT_EQ (last_iter
, 0);
278 last_iter
= test7 ();
279 ASSERT_EQ (last_iter
, 5);
281 last_iter
= test8 ();
282 ASSERT_EQ (last_iter
, -4);
284 last_iter
= test9 ();
285 ASSERT_EQ (last_iter
, -3);
287 last_iter
= test10 ();
288 ASSERT_EQ (last_iter
, -6);
290 last_iter
= test11 ();
291 ASSERT_EQ (last_iter
, -5);
293 last_iter
= test12 ();
294 ASSERT_EQ (last_iter
, 5);
296 last_iter
= test13 ();
297 ASSERT_EQ (last_iter
, 7);
299 last_iter
= test14 (0, 1);
300 ASSERT_EQ (last_iter
, 0);
302 last_iter
= test14 (0, -1);
303 ASSERT_EQ (last_iter
, 0);
305 last_iter
= test14 (8, 2);
306 ASSERT_EQ (last_iter
, 12);
308 last_iter
= test14 (5, 3);
309 ASSERT_EQ (last_iter
, 7);
311 last_iter
= test15 (8, -1);
312 ASSERT_EQ (last_iter
, 8);
314 last_iter
= test15 (8, -2);
315 ASSERT_EQ (last_iter
, 8);
317 last_iter
= test15 (5, -3);
318 ASSERT_EQ (last_iter
, 5);