1 /* { dg-require-effective-target size32plus } */
3 extern void abort (void);
4 int r
, a
[1024], b
[1024], x
, y
, z
;
6 __attribute__((noipa
)) void
9 #pragma omp for reduction (inscan, +:r) lastprivate (conditional: z) firstprivate (x) private (y)
10 for (int i
= 0; i
< 1024; i
++)
12 { y
= a
[i
]; r
+= y
+ x
+ 12; }
13 #pragma omp scan inclusive(r)
14 { b
[i
] = r
; if ((i
& 1) == 0 && i
< 937) z
= r
; }
18 __attribute__((noipa
)) int
23 #pragma omp for reduction (inscan, +:s) firstprivate (x) private (y) lastprivate (z)
24 for (int i
= 0; i
< 1024; i
++)
26 { y
= 2 * a
[i
]; s
+= y
; z
= y
; }
27 #pragma omp scan inclusive(s)
28 { y
= s
; b
[i
] = y
+ x
+ 12; }
33 __attribute__((noipa
)) void
36 #pragma omp parallel for reduction (inscan, +:r) firstprivate (x) lastprivate (x)
37 for (int i
= 0; i
< 1024; i
++)
39 { r
+= a
[i
] + x
+ 12; if (i
== 1023) x
= 29; }
40 #pragma omp scan inclusive(r)
45 __attribute__((noipa
)) int
49 #pragma omp parallel for reduction (inscan, +:s) lastprivate (conditional: x, y)
50 for (int i
= 0; i
< 1024; i
++)
52 { s
+= 2 * a
[i
]; if ((a
[i
] & 1) == 1 && i
< 825) x
= a
[i
]; }
53 #pragma omp scan inclusive(s)
54 { b
[i
] = s
; if ((a
[i
] & 1) == 0 && i
< 829) y
= a
[i
]; }
64 for (int i
= 0; i
< 1024; ++i
)
72 if (r
!= 1024 * 1023 / 2 || x
!= -12 || z
!= b
[936])
74 for (int i
= 0; i
< 1024; ++i
)
82 if (bar () != 1024 * 1023 || x
!= -12 || z
!= 2 * 1023)
85 for (int i
= 0; i
< 1024; ++i
)
95 if (r
!= 1024 * 1023 / 2 || x
!= 29)
98 for (int i
= 0; i
< 1024; ++i
)
106 if (qux () != 1024 * 1023 || x
!= 823 || y
!= 828)
109 for (int i
= 0; i
< 1024; ++i
)