Retro68/gcc/libgomp/testsuite/libgomp.c++/cancel-test.h

48 lines
414 B
C
Raw Normal View History

2014-09-21 17:33:12 +00:00
#include <stdlib.h>
#include <omp.h>
struct S
{
static int s;
int v;
S ()
{
#pragma omp atomic
s++;
}
S (int x)
{
#pragma omp atomic
s++;
v = x;
}
~S ()
{
#pragma omp atomic
s--;
}
S (const S &x)
{
#pragma omp atomic
s++;
v = x.v;
}
static void
verify ()
{
if (s) abort ();
}
void
bump ()
{
v++;
}
};
int S::s = 0;