// { dg-do run }
// { dg-options "-Wno-deprecated" }
extern "C" void abort (void);
bool v, x1, x2, x3, x4, x5, x6;
void
foo ()
{
#pragma omp atomic capture
v = ++x1;
if (!v)
abort ();
v = x2++;
if (v)
#pragma omp atomic read
v = x3;
v = x4;
{ v = x5; x5 |= 1; }
{ x6 |= 1; v = x6; }
}
bar ()
#pragma omp atomic write
x1 = false;
x2 = false;
{ ++x1; v = x1; }
{ v = x2; x2++; }
{ x1++; v = x1; }
{ v = x2; ++x2; }
int
main ()
x3 = true;
x4 = true;
foo ();
bar ();
return 0;