2 /* { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" } */
3 /* { dg-additional-options "-mavx" { target avx_runtime } } */
6 volatile int a
, b
, c
, d
, e
, f
, g
, h
;
8 extern void abort (void);
14 for (i
= 1; i
<= 10; i
++)
15 for (j
= 1; j
<= 10 * i
; j
++)
18 asm volatile ("" : : : "memory");
20 a
= 1; b
= 11; c
= 1; d
= 0; e
= 1; f
= 10; g
= 1; h
= 1;
21 niters
= 0; i
= -100; j
= -100; x
= -100;
22 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
23 for (i
= 1; i
<= 10; i
++)
24 for (j
= 1; j
<= 10 * i
; j
++)
30 err
|= (k
[i
][j
] != 1);
32 x
= i
* 1024 + (j
& 1023);
35 if (i
!= 11 || j
!= 101 || x
!= 10340 || niters
!= 550 || err
)
37 niters
= 0; i
= -100; j
= -100; x
= -100;
38 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
39 for (i
= a
; i
< b
; i
+= c
)
40 for (j
= d
* i
+ e
; j
< g
+ i
* f
; j
+= h
)
46 err
|= (k
[i
][j
] != 2);
48 x
= i
* 1024 + (j
& 1023);
51 if (i
!= 11 || j
!= 101 || x
!= 10340 || niters
!= 550 || err
)
53 for (i
= 1; i
<= 10; i
++)
54 for (j
= 1; j
<= 10 * i
; j
++)
59 for (i
= 0; i
< 11; i
++)
60 for (j
= 0; j
< 101; j
++)
63 for (i
= 0; i
< 10; i
++)
64 for (j
= 0; j
< 10 * i
; j
++)
67 asm volatile ("" : : : "memory");
69 a
= 0; b
= 10; c
= 1; d
= 0; e
= 0; f
= 10; g
= 0; h
= 1;
70 niters
= 0; i
= -100; j
= -100; x
= -100;
71 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
72 for (i
= 0; i
< 10; i
++)
73 for (j
= 0; j
< 10 * i
; j
++)
79 err
|= (k
[i
][j
] != 1);
81 x
= i
* 1024 + (j
& 1023);
84 if (i
!= 10 || j
!= 90 || x
!= 9305 || niters
!= 450 || err
)
86 niters
= 0; i
= -100; j
= -100; x
= -100;
87 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
88 for (i
= a
; i
< b
; i
+= c
)
89 for (j
= d
* i
+ e
; j
< g
+ i
* f
; j
+= h
)
95 err
|= (k
[i
][j
] != 2);
97 x
= i
* 1024 + (j
& 1023);
100 if (i
!= 10 || j
!= 90 || x
!= 9305 || niters
!= 450 || err
)
102 for (i
= 0; i
< 10; i
++)
103 for (j
= 0; j
< 10 * i
; j
++)
108 for (i
= 0; i
< 11; i
++)
109 for (j
= 0; j
< 101; j
++)
112 for (i
= 4; i
< 10; i
++)
113 for (j
= -9 + 2 * i
; j
< i
; j
++)
116 asm volatile ("" : : : "memory");
118 a
= 4; b
= 10; c
= 1; d
= 2; e
= -9; f
= 1; g
= 0; h
= 1;
119 niters
= 0; i
= -100; j
= -100; x
= -100;
120 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
121 for (i
= 4; i
< 10; i
++)
122 for (j
= -9 + 2 * i
; j
< i
; j
++)
126 err
|= (j
< -9 + 2 * i
);
128 err
|= (k
[i
][j
+ 1] != 1);
130 x
= i
* 1024 + (j
& 1023);
133 if (/*i != 10 || j != 9 || */x
!= 8199 || niters
!= 15 || err
)
135 niters
= 0; i
= -100; j
= -100; x
= -100;
136 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
137 for (i
= a
; i
< b
; i
+= c
)
138 for (j
= d
* i
+ e
; j
< g
+ i
* f
; j
+= h
)
142 err
|= (j
< -9 + 2 * i
);
144 err
|= (k
[i
][j
+ 1] != 2);
146 x
= i
* 1024 + (j
& 1023);
149 if (/*i != 10 || j != 9 || */x
!= 8199 || niters
!= 15 || err
)
151 for (i
= 4; i
< 10; i
++)
152 for (j
= -9 + 2 * i
; j
< i
; j
++)
153 if (k
[i
][j
+ 1] == 3)
157 for (i
= 0; i
< 11; i
++)
158 for (j
= 0; j
< 101; j
++)
161 for (i
= 1; i
< 10; i
+= 2)
162 for (j
= 1; j
< i
+ 1; j
++)
165 asm volatile ("" : : : "memory");
167 a
= 1; b
= 10; c
= 2; d
= 0; e
= 1; f
= 1; g
= 1; h
= 1;
168 niters
= 0; i
= -100; j
= -100; x
= -100;
169 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
170 for (i
= 1; i
< 10; i
+= 2)
171 for (j
= 1; j
< i
+ 1; j
++)
177 err
|= (k
[i
][j
] != 1);
179 x
= i
* 1024 + (j
& 1023);
182 if (i
!= 11 || j
!= 10 || x
!= 9225 || niters
!= 25 || err
)
184 niters
= 0; i
= -100; j
= -100; x
= -100;
185 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
186 for (i
= a
; i
< b
; i
+= c
)
187 for (j
= d
* i
+ e
; j
< g
+ i
* f
; j
+= h
)
193 err
|= (k
[i
][j
] != 2);
195 x
= i
* 1024 + (j
& 1023);
198 if (i
!= 11 || j
!= 10 || x
!= 9225 || niters
!= 25 || err
)
200 for (i
= 1; i
< 10; i
+= 2)
201 for (j
= 1; j
< i
+ 1; j
++)
206 for (i
= 0; i
< 11; i
++)
207 for (j
= 0; j
< 101; j
++)
210 for (j
= -11; j
>= -41; j
-= 15)
213 asm volatile ("" : : : "memory");
215 a
= 4; b
= 8; c
= 12; d
= -8; e
= -9; f
= -3; g
= 6; h
= 15;
216 niters
= 0; i
= -100; j
= -100; x
= -100;
217 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
218 for (i
= 4; i
< 8; i
+= 12)
219 for (j
= -8 * i
- 9; j
< i
* -3 + 6; j
+= 15)
224 err
|= (k
[0][-j
] != 1);
226 x
= i
* 1024 + (j
& 1023);
229 if (i
!= 16 || j
!= 4 || x
!= 5109 || niters
!= 3 || err
)
231 niters
= 0; i
= -100; j
= -100; x
= -100;
232 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
233 for (i
= a
; i
< b
; i
+= c
)
234 for (j
= d
* i
+ e
; j
< g
+ i
* f
; j
+= h
)
239 err
|= (k
[0][-j
] != 2);
241 x
= i
* 1024 + (j
& 1023);
244 if (i
!= 16 || j
!= 4 || x
!= 5109 || niters
!= 3 || err
)
246 for (j
= -11; j
>= -41; j
-= 15)
251 for (j
= -11; j
>= -41; j
--)
254 for (j
= -34; j
<= -7; j
++)
257 asm volatile ("" : : : "memory");
259 a
= -13; b
= 7; c
= 12; d
= 3; e
= 5; f
= 0; g
= -6; h
= 1;
260 niters
= 0; i
= -100; j
= -100; x
= -100;
261 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
262 for (i
= -13; i
< 7; i
+= 12)
263 for (j
= 3 * i
+ 5; j
< -6; j
++)
268 err
|= (k
[0][-j
] != 1);
270 x
= i
* 1024 + (j
& 1023);
273 if (/*i != 11 || j != 2 || */x
!= -12295 || niters
!= 28 || err
)
275 niters
= 0; i
= -100; j
= -100; x
= -100;
276 #pragma omp parallel for simd collapse(2) lastprivate (i, j, x) reduction(+:niters) reduction(|:err)
277 for (i
= a
; i
< b
; i
+= c
)
278 for (j
= d
* i
+ e
; j
< g
+ i
* f
; j
+= h
)
283 err
|= (k
[0][-j
] != 2);
285 x
= i
* 1024 + (j
& 1023);
288 if (/*i != 11 || j != 2 || */x
!= -12295 || niters
!= 28 || err
)
290 for (j
= -34; j
<= -7; j
++)