gcc/libgomp/testsuite/libgomp.c++/tls-init1.C
2012-10-25 11:53:40 -04:00

29 lines
237 B
C

// { dg-require-alias }
extern "C" void abort();
struct A
{
A();
int i;
};
extern A a;
#pragma omp threadprivate (a)
A a;
A &f()
{
return a;
}
int j;
A::A(): i(j) { }
int main()
{
j = 42;
if (f().i != 42)
abort ();
}