20a1e5b8c8
* typeck.c (cp_build_unary_op): Diagnose incrementing boolean expressions. Tweak an error message. * c-c++-common/gomp/atomic-12.c: Use -Wno-deprecated. * c-c++-common/gomp/atomic-13.c: Likewise. * c-c++-common/gomp/atomic-14.c: Likewise. * g++.dg/cpp1y/lambda-init11.C: Remove invalid code. * g++.dg/cpp1z/bool-increment1.C: New test. * c-c++-common/pr60439.c: Add dg-warning. * g++.dg/expr/bitfield4.C: Likewise. * g++.dg/expr/bitfield5.C: Likewise. * g++.dg/expr/bitfield6.C: Likewise. * g++.dg/expr/bool1.C: Likewise. * g++.dg/expr/bool3.C: Likewise. * g++.dg/expr/lval3.C: Likewise. * g++.dg/expr/lval4.C: Likewise. * g++.old-deja/g++.jason/bool5.C: Likewise. * g++.dg/expr/bitfield3.C: Adjust dg-error. * g++.dg/other/error18.C: Likewise. * g++.dg/gomp/atomic-14.C: Likewise. libgomp/ * testsuite/libgomp.c++/atomic-3.C: Use -Wno-deprecated. libstdc++-v3/ * testsuite/23_containers/vector/debug/insert6_neg.cc: Use -Wno-deprecated. From-SVN: r240141
76 lines
1.1 KiB
C
76 lines
1.1 KiB
C
// { 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 ();
|
|
#pragma omp atomic capture
|
|
v = x2++;
|
|
if (v)
|
|
abort ();
|
|
#pragma omp atomic read
|
|
v = x3;
|
|
if (!v)
|
|
abort ();
|
|
#pragma omp atomic read
|
|
v = x4;
|
|
if (!v)
|
|
abort ();
|
|
#pragma omp atomic capture
|
|
{ v = x5; x5 |= 1; }
|
|
if (v)
|
|
abort ();
|
|
#pragma omp atomic capture
|
|
{ x6 |= 1; v = x6; }
|
|
if (!v)
|
|
abort ();
|
|
}
|
|
|
|
void
|
|
bar ()
|
|
{
|
|
#pragma omp atomic write
|
|
x1 = false;
|
|
#pragma omp atomic write
|
|
x2 = false;
|
|
#pragma omp atomic capture
|
|
{ ++x1; v = x1; }
|
|
if (!v)
|
|
abort ();
|
|
#pragma omp atomic capture
|
|
{ v = x2; x2++; }
|
|
if (v)
|
|
abort ();
|
|
#pragma omp atomic write
|
|
x1 = false;
|
|
#pragma omp atomic write
|
|
x2 = false;
|
|
#pragma omp atomic capture
|
|
{ x1++; v = x1; }
|
|
if (!v)
|
|
abort ();
|
|
#pragma omp atomic capture
|
|
{ v = x2; ++x2; }
|
|
if (v)
|
|
abort ();
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
#pragma omp atomic write
|
|
x3 = true;
|
|
#pragma omp atomic write
|
|
x4 = true;
|
|
foo ();
|
|
bar ();
|
|
return 0;
|
|
}
|