6 struct S
{ long int s
, t
; };
9 bar (struct S
*p
, struct S
*o
)
18 baz (struct S
*o
, struct S
*i
)
20 if (o
->t
!= 5 || i
->t
!= 9)
25 #pragma omp declare reduction (+: struct S : omp_out.s += omp_in.s) initializer (omp_priv = { 0, 3 })
26 #pragma omp declare reduction (*: struct S : baz (&omp_out, &omp_in)) initializer (bar (&omp_priv, &omp_orig))
28 struct S a
= { 0, 7 };
29 struct S b
= { 1, 5 };
35 for (i
= 0; i
< 2; i
++)
36 #pragma omp task in_reduction (*: b) in_reduction (+: a)
40 if ((a
.t
!= 7 && a
.t
!= 3) || (b
.t
!= 5 && b
.t
!= 9))
48 struct S c
= { 0, 7 };
52 struct S d
= { 1, 5 };
53 #pragma omp taskgroup task_reduction (+: a, c) task_reduction (*: b, d)
56 for (i
= 0; i
< 4; i
++)
57 #pragma omp task in_reduction (*: b, d) in_reduction (+: a, c)
62 for (j
= 0; j
< 2; j
++)
63 #pragma omp task in_reduction (+: a) in_reduction (*: b) \
64 in_reduction (+: c) in_reduction (*: d)
71 if ((a
.t
!= 7 && a
.t
!= 3) || (b
.t
!= 5 && b
.t
!= 9)
72 || (c
.t
!= 7 && c
.t
!= 3) || (d
.t
!= 5 && d
.t
!= 9))
77 if ((a
.t
!= 7 && a
.t
!= 3) || (b
.t
!= 5 && b
.t
!= 9)
78 || (c
.t
!= 7 && c
.t
!= 3) || (d
.t
!= 5 && d
.t
!= 9))
82 #define THREEP4 (3L * 3L * 3L * 3L)
83 if (d
.s
!= (THREEP4
* THREEP4
* THREEP4
) || d
.t
!= 5)
86 if (a
.s
!= 28 * 7 || a
.t
!= 7 || b
.s
!= (1L << 28) || b
.t
!= 5
87 || c
.s
!= 12 * 9 || c
.t
!= 7)