5 struct R { R () {}; ~R () {}; int r; };
6 struct T { T () {}; virtual ~T () {}; int t; };
8 struct A : public R, virtual public T { A () : b(c) {} int a; int &b; void m1 (); };
11 take (int &a, int &b, int &c, int &d)
13 asm volatile ("" : : "g" (&a), "g" (&b), "g" (&c), "g" (&d) : "memory");
19 #pragma omp parallel private (a, T::t) shared (r, A::b) default(none)
21 int q = omp_get_thread_num (), q2;
24 #pragma omp single copyprivate (q2)
32 if (A::a != q || R::r != 2 * q2 || T::t != 3 * q || A::b != 4 * q2)
39 #pragma omp parallel shared (A::a) default (none) firstprivate (R::r, b) shared (t)
41 int q = omp_get_thread_num (), q2;
42 take (A::a, R::r, T::t, A::b);
43 if (a != 7 || r != 8 || t != 9 || b != 10)
47 #pragma omp single copyprivate (q2)
56 if (a != 5 * q2 || r != 6 * q || t != 7 * q2 || b != 8 * q)
64 #pragma omp parallel private (f)
68 #pragma omp taskloop default(none) firstprivate (r, A::a, f) shared (T::t, b)
69 for (int i = 0; i < 30; i++)
71 int q = omp_get_thread_num ();
73 #pragma omp atomic read
75 #pragma omp atomic read
79 if (bv != 2 || tv != 4)
84 if ((bv != 2 && bv != 8) || (tv != 4 && tv != 9))
89 if (A::a != 1 || R::r != 3)
92 else if (a != 7 * q || r != 9 * q)
99 #pragma omp atomic write
101 #pragma omp atomic write