PR rtl-optimization/77919
[official-gcc.git] / libgomp / testsuite / libgomp.c / udr-2.c
blobb58b5c781ab893578bcb86b95a6baefcbbe865f5
1 /* { dg-do run } */
3 extern void abort ();
5 struct S { int s; };
7 #pragma omp declare reduction (+:struct S:omp_out.s += omp_in.s)
8 #pragma omp declare reduction (foo:struct S:omp_out.s += omp_in.s)
9 #pragma omp declare reduction (foo:int:omp_out += omp_in)
11 int
12 main ()
14 int u = 0, q = 0;
15 struct S s, t;
16 s.s = 0; t.s = 0;
17 #pragma omp parallel reduction(+:s, q) reduction(foo:t, u)
19 if (s.s != 0 || t.s != 0 || u != 0 || q != 0) abort ();
20 s.s = 6;
21 t.s = 8;
22 u = 9;
23 q++;
25 if (s.s != 6 * q || t.s != 8 * q || u != 9 * q) abort ();
26 return 0;