| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fopenmp -fdump-tree-ompexp" } */ |
| 3 |
/* { dg-final { scan-tree-dump-times "GOMP_loop_start " 3 "ompexp" } } */ |
| 4 |
/* { dg-final { scan-tree-dump-times "GOMP_loop_end_nowait " 3 "ompexp" } } */ |
| 5 |
|
| 6 |
int r; |
| 7 |
|
| 8 |
void |
| 9 |
foo (int *a) |
| 10 |
{ |
| 11 |
#pragma omp for nowait lastprivate(conditional: r) |
| 12 |
for (int i = 0; i < 64; ++i) |
| 13 |
if (a[i]) |
| 14 |
r = a[i]; |
| 15 |
} |
| 16 |
|
| 17 |
void |
| 18 |
bar (int *a) |
| 19 |
{ |
| 20 |
#pragma omp for nowait lastprivate(conditional: r) schedule (static, 4) |
| 21 |
for (int i = 0; i < 64; ++i) |
| 22 |
if (a[i]) |
| 23 |
r = a[i]; |
| 24 |
} |
| 25 |
|
| 26 |
void |
| 27 |
baz (int *a) |
| 28 |
{ |
| 29 |
#pragma omp for nowait lastprivate(conditional: r) schedule (runtime) |
| 30 |
for (int i = 0; i < 64; ++i) |
| 31 |
if (a[i]) |
| 32 |
r = a[i]; |
| 33 |
} |