Mercurial > hg > CbC > CbC_gcc
annotate libgomp/testsuite/libgomp.c/udr-3.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* { dg-do run } */ |
2 | |
3 extern void abort (); | |
4 | |
5 struct S; | |
6 void foo (struct S *, struct S *); | |
7 #pragma omp declare reduction (+:struct S:foo (&omp_out, &omp_in)) | |
8 struct S { int s; }; | |
9 | |
10 void | |
11 foo (struct S *x, struct S *y) | |
12 { | |
13 x->s += y->s; | |
14 } | |
15 | |
16 int | |
17 main () | |
18 { | |
19 struct S s; | |
20 int i = 0; | |
21 s.s = 0; | |
22 #pragma omp parallel reduction (+:s, i) | |
23 { | |
24 if (s.s != 0) | |
25 abort (); | |
26 s.s = 2; | |
27 i = 1; | |
28 } | |
29 if (s.s != 2 * i) | |
30 abort (); | |
31 return 0; | |
32 } |