mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-02 03:50:17 +00:00
42 lines
351 B
C
42 lines
351 B
C
// PR c++/81130
|
|
// { dg-do run }
|
|
|
|
struct A
|
|
{
|
|
A ();
|
|
~A ();
|
|
int a;
|
|
};
|
|
|
|
A::A ()
|
|
{
|
|
a = 0;
|
|
}
|
|
|
|
A::~A ()
|
|
{
|
|
}
|
|
|
|
struct B
|
|
{
|
|
A b;
|
|
int c;
|
|
B () : c (1)
|
|
{
|
|
#pragma omp parallel shared (b, c) num_threads (2)
|
|
#pragma omp master
|
|
{
|
|
b.a++;
|
|
c += 2;
|
|
}
|
|
}
|
|
};
|
|
|
|
int
|
|
main ()
|
|
{
|
|
B v;
|
|
if (v.b.a != 1 || v.c != 3)
|
|
__builtin_abort ();
|
|
}
|