#ifndef HEADER
#define HEADER
void foo() {}
struct SS {
int a;
int b : 4;
int &c;
SS(int &d) : a(0), b(0), c(d) {
#pragma omp parallel firstprivate(a, b, c)
#pragma omp single copyprivate(a, this->b, (this)->c)
++this->a, --b, (this)->c /= 1;
}
};
template<typename T>
struct SST {
T a;
SST() : a(T()) {
#pragma omp parallel firstprivate(a)
#pragma omp single copyprivate(this->a)
++this->a;
}
};
template <class T, int N>
T tmain(T argc) {
T b = argc, c, d, e, f, g;
static T a;
SST<T> sst;
#pragma omp parallel private(g)
#pragma omp single private(argc, b), firstprivate(c, d), nowait allocate(d)
foo();
#pragma omp parallel private(g)
#pragma omp single allocate(argc) private(argc, b), firstprivate(c, d), copyprivate(g)
foo();
return T();
}
int main(int argc, char **argv) {
int b = argc, c, d, e, f, g;
static int a;
SS ss(a);
#pragma omp parallel private(g)
#pragma omp single private(argc, b), firstprivate(argv, c), nowait
foo();
#pragma omp parallel private(g)
#pragma omp single private(argc, b), firstprivate(c, d), copyprivate(g)
foo();
return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0]));
}
#endif