2 /* { dg-additional-options "-msse2" { target sse2_runtime } } */
3 /* { dg-additional-options "-mavx" { target avx_runtime } } */
6 foo (int *b
, int *i
, int *j
, int x
)
8 *b
= *b
+ x
+ (*i
- *i
) + (*j
- *j
);
16 #pragma omp simd linear(b:2) reduction(+:c)
17 for (i
= 0; i
< 64; i
++)
19 c
= c
+ (b
!= 7 + 2 * i
);
22 if (c
|| i
!= 64 || b
!= 7 + 64 * 2)
25 #pragma omp simd linear(b:3) reduction(+:c)
26 for (i
= 0; i
< 64; i
+= 4)
28 c
= c
+ (b
!= 7 + i
/ 4 * 3);
31 if (c
|| i
!= 64 || b
!= 7 + 16 * 3)
34 #pragma omp simd linear(i) linear(b:2) reduction(+:c)
35 for (i
= 0; i
< 64; i
++)
37 c
= c
+ (b
!= 7 + 2 * i
);
40 if (c
|| i
!= 64 || b
!= 7 + 64 * 2)
43 #pragma omp simd linear(i:4) linear(b:3) reduction(+:c)
44 for (i
= 0; i
< 64; i
+= 4)
46 c
= c
+ (b
!= 7 + i
/ 4 * 3);
49 if (c
|| i
!= 64 || b
!= 7 + 16 * 3)
52 #pragma omp simd collapse (2) linear(b:2) reduction(+:c)
53 for (i
= 0; i
< 8; i
++)
54 for (j
= 0; j
< 8; j
++)
56 c
= c
+ (b
!= 7 + 2 * j
+ 2 * 8 * i
);
59 if (c
|| i
!= 8 || j
!= 8 || b
!= 7 + 64 * 2)
62 #pragma omp simd collapse (2) lastprivate (i, j) linear(b:2) reduction(+:c)
63 for (i
= 0; i
< 8; i
++)
64 for (j
= 0; j
< 8; j
++)
66 c
= c
+ (b
!= 7 + 2 * j
+ 2 * 8 * i
);
69 if (c
|| i
!= 8 || j
!= 8 || b
!= 7 + 64 * 2)
72 #pragma omp parallel for simd schedule (static, 4) linear(b:2) reduction(+:c)
73 for (i
= 0; i
< 64; i
++)
75 c
= c
+ (b
!= 7 + 2 * i
);
78 if (c
|| i
!= 64 || b
!= 7 + 64 * 2)
81 #pragma omp parallel for simd schedule (static, 4) linear(b:3) reduction(+:c)
82 for (i
= 0; i
< 64; i
+= 4)
84 c
= c
+ (b
!= 7 + i
/ 4 * 3);
87 if (c
|| i
!= 64 || b
!= 7 + 16 * 3)
90 #pragma omp parallel for simd schedule (static, 4) linear(i) linear(b:2) reduction(+:c)
91 for (i
= 0; i
< 64; i
++)
93 c
= c
+ (b
!= 7 + 2 * i
);
96 if (c
|| i
!= 64 || b
!= 7 + 64 * 2)
99 #pragma omp parallel for simd schedule (static, 4) linear(i:4) linear(b:3) reduction(+:c)
100 for (i
= 0; i
< 64; i
+= 4)
102 c
= c
+ (b
!= 7 + i
/ 4 * 3);
105 if (c
|| i
!= 64 || b
!= 7 + 16 * 3)
108 #pragma omp parallel for simd lastprivate (i, j) collapse (2) schedule (static, 4) linear(b:2) reduction(+:c)
109 for (i
= 0; i
< 8; i
++)
110 for (j
= 0; j
< 8; j
++)
112 c
= c
+ (b
!= 7 + 2 * j
+ 2 * 8 * i
);
115 if (c
|| i
!= 8 || j
!= 8 || b
!= 7 + 64 * 2)
118 #pragma omp parallel for simd collapse (2) schedule (static, 4) linear(b:2) reduction(+:c)
119 for (i
= 0; i
< 8; i
++)
120 for (j
= 0; j
< 8; j
++)
122 c
= c
+ (b
!= 7 + 2 * j
+ 2 * 8 * i
);
125 if (c
|| i
!= 8 || j
!= 8 || b
!= 7 + 64 * 2)