aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/pr81314.C
blob: afe89438bd3f1f95a4159fd755d05dc9148dbba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// PR c++/81314
// { dg-do link }

template <int N>
struct S {
  S () { s = 0; }
  S (const S &x) { s = x.s; }
  ~S () {}
  int s;
};

void
foo (S<2> &x)
{
  #pragma omp taskloop
  for (int i = 0; i < 100; ++i)
    x.s++;
}

void
bar (S<3> &x)
{
  #pragma omp task
  x.s++;
}

int
main ()
{
  S<2> s;
  S<3> t;
  #pragma omp parallel
  #pragma omp master
  {
    foo (s);
    bar (t);
  }
}