Retro68/gcc/libgomp/testsuite/libgomp.c++/tls-init1.C

29 lines
237 B
C++
Raw Normal View History

2014-09-21 17:33:12 +00:00
// { 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 ();
}