2 // { dg-require-effective-target tls_runtime }
12 B& operator=(const B &);
17 static int singlethread;
18 #pragma omp threadprivate(threadbase)
20 static unsigned cmask[THR];
22 B& B::operator= (const B &b)
24 unsigned sindex = &b - base;
25 unsigned tindex = this - threadbase;
27 assert(sindex == tindex);
28 cmask[omp_get_thread_num ()] |= 1u << tindex;
38 #pragma omp single copyprivate(b)
40 assert(omp_get_num_threads () == THR);
41 singlethread = omp_get_thread_num ();
50 omp_set_num_threads (THR);
53 for (int i = 0; i < THR; ++i)
54 if (i == singlethread)
55 assert(cmask[singlethread] == 0);
57 assert(cmask[i] == (1u << N) - 1);