summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/flush-1.C
blob: 3c6a34bff371cc2fb1713b839e1b6bd2e0eb7b86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-gimple" } */

void f1(void)
{
  #pragma omp flush
}

int x;

void f2(bool p)
{
  int z;
  if (p)
    {
      #pragma omp flush (x)
    }
  else
    {
      #pragma omp flush (x, z, p)
    }
}

/* { dg-final { scan-tree-dump-times "__sync_synchronize" 3 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */