summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/appendix-a/a.21.2.c
blob: a9b81d0c39992961ba6019fc3a89405a3fa30d9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile } */

void
work (int i)
{
}

void
a21_wrong (int n)
{
  int i;
#pragma omp for ordered
  for (i = 0; i < n; i++)
    {
/* incorrect because an iteration may not execute more than one
    ordered region */
#pragma omp ordered
      work (i);
#pragma omp ordered
      work (i + 1);
    }
}