2 /* { dg-require-effective-target tls_runtime } */
3 /* { dg-additional-options "-std=gnu99" {target c } } */
8 int r
, s
, u
, v
, r2
, s2
, u2
, v2
, r3
, s3
, u3
, v3
, t
;
9 long long w
, w2
, w3
, p
, p2
, p3
;
14 #pragma omp threadprivate (thr1, thr2)
17 foo (int *a
, long long int b
, long long int c
)
21 #pragma omp for lastprivate (conditional: u, x) reduction (task, +: t)
22 for (i
= 15; i
< 64; i
++)
30 #pragma omp for lastprivate (conditional: v) reduction (+:r, s) schedule (nonmonotonic: static) reduction (task, +: t)
31 for (i
= -3; i
< 119; i
+= 2)
35 if ((a
[i
+ 4] % 11) == 9)
40 #pragma omp for schedule (monotonic: static) lastprivate (conditional: w) reduction (task, +: t)
41 for (j
= b
; j
< b
+ 115 * c
; j
+= (b
& 3) + 7)
47 #pragma omp for schedule (auto) lastprivate (conditional: p) collapse(3) reduction (task, +: t)
48 for (i
= -5; i
< (int) (b
+ 5); i
+= 2)
49 for (j
= b
+ 12 + c
; j
> b
; --j
)
50 for (int k
= 0; k
< 5; k
+= c
)
53 if (((((i
+ 5) * 13 + (13 - j
)) * 5 + k
) % 17) == 6)
54 p
= i
* 10000 + j
* 100 + k
;
57 #pragma omp for schedule (nonmonotonic: static, 2) reduction (task, +: t) lastprivate (conditional: u2, x2)
58 for (i
= 15; i
< 64; i
++)
66 #pragma omp for schedule (static, 3) lastprivate (conditional: v2) reduction (+:r2, s2) reduction (task, +: t)
67 for (i
= -3; i
< 119; i
+= 2)
70 if ((a
[i
+ 4] % 11) == 9)
76 #pragma omp for lastprivate (conditional: w2) schedule (static, 1) reduction (task, +: t)
77 for (j
= b
; j
< b
+ 115 * c
; j
+= (b
& 3) + 7)
83 #pragma omp for schedule (static, 3) collapse (3) reduction (task, +: t) lastprivate (conditional: p2)
84 for (i
= -5; i
< (int) (b
+ 5); i
+= 2)
85 for (j
= b
+ 12 + c
; j
> b
; --j
)
86 for (int k
= 0; k
< 5; k
+= c
)
89 if (((((i
+ 5) * 13 + (13 - j
)) * 5 + k
) % 17) == 6)
90 p2
= i
* 10000 + j
* 100 + k
;
93 #pragma omp for lastprivate (conditional: u3, x3) reduction (task, +: t) schedule (runtime)
94 for (i
= 15; i
< 64; i
++)
102 #pragma omp for reduction (task, +: t) lastprivate (conditional: v3) reduction (+:r3, s3) schedule (nonmonotonic: dynamic)
103 for (i
= -3; i
< 119; i
+= 2)
106 if ((a
[i
+ 4] % 11) == 9)
112 #pragma omp for schedule (monotonic: guided, 3) lastprivate (conditional: w3) reduction (task, +: t)
113 for (j
= b
; j
< b
+ 115 * c
; j
+= (b
& 3) + 7)
115 if ((a
[j
] % 13) == 5)
119 #pragma omp for schedule (dynamic, 4) lastprivate (conditional: p3) collapse(3) reduction (task, +: t)
120 for (i
= -5; i
< (int) (b
+ 5); i
+= 2)
121 for (j
= b
+ 12 + c
; j
> b
; --j
)
122 for (int k
= 0; k
< 5; k
+= c
)
125 if (((((i
+ 5) * 13 + (13 - j
)) * 5 + k
) % 17) == 6)
126 p3
= i
* 10000 + j
* 100 + k
;
129 /* Nasty testcase, verify that even a no-op assignment is accounted
130 for in lastprivate(conditional:). */
131 #pragma omp for schedule (monotonic: static, 2) firstprivate (z) \
132 lastprivate (conditional: z) reduction (task, +: t)
133 for (int k
= -2000; k
< 8000; ++k
)
136 if (k
< 3000 && (k
& 3) == 1)
148 if (thr2
&& z
!= thr1
)
157 for (i
= 0; i
< 128; i
++)
162 if (u
!= 63 || v
!= 115 || w
!= 140 || x
!= &a
[58] || r
!= 55 || s
!= 61 || p
!= 30104)
164 if (u2
!= 63 || v2
!= 115 || w2
!= 140 || x2
!= &a
[58] || r2
!= 55 || s2
!= 61 || p2
!= 30104)
166 if (u3
!= 63 || v3
!= 115 || w3
!= 140 || x3
!= &a
[58] || r3
!= 55 || s3
!= 61 || p3
!= 30104)