6 struct R { R () {}; ~R () {}; int r; };
8 struct T { T () : t(d) {}; virtual ~T () {}; Q t; };
10 struct A : public R, virtual public T<Q> { A () : b(c), a(e) {} Q a; int &b; void m1 (); };
13 take (int &a, int &b, int &c, int &d)
15 asm volatile ("" : : "g" (&a), "g" (&b), "g" (&c), "g" (&d) : "memory");
22 #pragma omp parallel private (a, T<Q>::t) shared (r, A::b) default(none)
24 int q = omp_get_thread_num (), q2;
27 #pragma omp single copyprivate (q2)
33 take (a, r, T<Q>::t, b);
35 if (A::a != q || R::r != 2 * q2 || T<Q>::t != 3 * q || A::b != 4 * q2)
42 #pragma omp parallel shared (A::a) default (none) firstprivate (R::r, b) shared (T<Q>::t)
44 int q = omp_get_thread_num (), q2;
45 take (A::a, R::r, T<Q>::t, A::b);
46 if (a != 7 || r != 8 || T<Q>::t != 9 || b != 10)
50 #pragma omp single copyprivate (q2)
57 take (a, r, T<Q>::t, b);
59 if (a != 5 * q2 || r != 6 * q || T<Q>::t != 7 * q2 || b != 8 * q)
67 #pragma omp parallel private (f)
71 #pragma omp taskloop default(none) firstprivate (r, A::a, f) shared (T<Q>::t, b)
72 for (int i = 0; i < 30; i++)
74 int q = omp_get_thread_num ();
76 #pragma omp atomic read
78 #pragma omp atomic read
82 if (bv != 2 || tv != 4)
87 if ((bv != 2 && bv != 8) || (tv != 4 && tv != 9))
92 if (A::a != 1 || R::r != 3)
95 else if (a != 7 * q || r != 9 * q)
97 take (a, r, T<Q>::t, b);
102 #pragma omp atomic write
104 #pragma omp atomic write