aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/pr86542.C
blob: 5d42ea678a22ed204399a196bd489c8fa799e90d (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
// PR middle-end/86542

struct S { int s; S (); ~S (); S (const S &); };
S s;

S::S ()
{
}

S::~S ()
{
}

S::S (const S &x)
{
  s = x.s;
}

__attribute__((noipa)) void
foo (int i, int j, int k, S s)
{
  if (i != 0 || j != 0 || k != 0 || s.s != 12)
    __builtin_abort ();
}

int
main ()
{
  volatile int inc = 16, jnc = 16, knc = 16;
  s.s = 12;
  #pragma omp taskloop collapse (3) firstprivate (s)
  for (int i = 0; i < 16; i += inc)
    for (int j = 0; j < 16; j += jnc)
      for (int k = 0; k < 16; k += knc)
	foo (i, j, k, s);
  return 0;
}