2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / libgomp / testsuite / libgomp.c++ / pr81314.C
blobafe89438bd3f1f95a4159fd755d05dc9148dbba1
1 // PR c++/81314
2 // { dg-do link }
4 template <int N>
5 struct S {
6   S () { s = 0; }
7   S (const S &x) { s = x.s; }
8   ~S () {}
9   int s;
12 void
13 foo (S<2> &x)
15   #pragma omp taskloop
16   for (int i = 0; i < 100; ++i)
17     x.s++;
20 void
21 bar (S<3> &x)
23   #pragma omp task
24   x.s++;
27 int
28 main ()
30   S<2> s;
31   S<3> t;
32   #pragma omp parallel
33   #pragma omp master
34   {
35     foo (s);
36     bar (t);
37   }