1 // PR middle-end/86542
2 
3 struct S { int s; S (); ~S (); S (const S &); };
4 S s;
5 
S()6 S::S ()
7 {
8 }
9 
~S()10 S::~S ()
11 {
12 }
13 
S(const S & x)14 S::S (const S &x)
15 {
16   s = x.s;
17 }
18 
19 __attribute__((noipa)) void
foo(int i,int j,int k,S s)20 foo (int i, int j, int k, S s)
21 {
22   if (i != 0 || j != 0 || k != 0 || s.s != 12)
23     __builtin_abort ();
24 }
25 
26 int
main()27 main ()
28 {
29   volatile int inc = 16, jnc = 16, knc = 16;
30   s.s = 12;
31   #pragma omp taskloop collapse (3) firstprivate (s)
32   for (int i = 0; i < 16; i += inc)
33     for (int j = 0; j < 16; j += jnc)
34       for (int k = 0; k < 16; k += knc)
35 	foo (i, j, k, s);
36   return 0;
37 }
38