gcc/testsuite/gcc.dg/gomp/appendix-a/a.13.1.c
raw| 1 | /* { dg-do compile } */ |
| 2 | |
| 3 | int dequeue (float *a); |
| 4 | void work (int i, float *a); |
| 5 | void |
| 6 | a13 (float *x, float *y) |
| 7 | { |
| 8 | int ix_next, iy_next; |
| 9 | #pragma omp parallel shared(x, y) private(ix_next, iy_next) |
| 10 | { |
| 11 | #pragma omp critical (xaxis) |
| 12 | ix_next = dequeue (x); |
| 13 | work (ix_next, x); |
| 14 | #pragma omp critical (yaxis) |
| 15 | iy_next = dequeue (y); |
| 16 | work (iy_next, y); |
| 17 | } |
| 18 | } |