aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/gomp/lastprivate-conditional-4.c
blob: d87c7982b2693c4c72c38e950eee1aae609c2aed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
int x = 6, w = 8;
int bar (int);

void
foo ()
{
  int y = 5, i;
  #pragma omp teams num_teams(1) firstprivate (x) shared (y) shared (w)
  {
    int z = 7;
    #pragma omp parallel for firstprivate (x, y, z, w) lastprivate (conditional: x, y, z, w)
    for (i = 0; i < 64; i++)
      if (bar (i))
	{
	  x = i;
	  y = i + 1;
	  z = i + 2;
	  w = i + 3;
	}
    bar (y);
    bar (z);
  }
}