Fix xfail for 32-bit hppa*-*-* in gcc.dg/pr84877.c
[official-gcc.git] / libgomp / testsuite / libgomp.c++ / task-reduction-1.C
blobb3e228e5310c32044807885a2728cca7a578cc58
1 extern "C" void abort ();
3 int as;
4 int &a = as;
5 long int bs = 1;
6 long int &b = bs;
8 void
9 foo (int &c, long long int &d)
11   int i;
12   for (i = 0; i < 2; i++)
13     #pragma omp task in_reduction (*: d) in_reduction (+: c) \
14                      in_reduction (+: a) in_reduction (*: b)
15     {
16       a += 7;
17       b *= 2;
18       c += 9;
19       d *= 3;
20     }
23 int
24 main ()
26   int cs = 0;
27   int &c = cs;
28   long long int ds = 1;
29   #pragma omp parallel
30   #pragma omp single
31   {
32     long long int &d = ds;
33     #pragma omp taskgroup task_reduction (+: a, c) task_reduction (*: b, d)
34     {
35       int i;
36       for (i = 0; i < 4; i++)
37         #pragma omp task in_reduction (+: a, c) in_reduction (*: b, d)
38         {
39           int j;
40           a += 7;
41           b *= 2;
42           for (j = 0; j < 2; j++)
43             #pragma omp task in_reduction (+: a, c) in_reduction (*: b, d)
44             {
45               a += 7;
46               b *= 2;
47               c += 9;
48               d *= 3;
49               foo (c, d);
50             }
51           c += 9;
52           d *= 3;
53         }
54     }
55 #define THREEP4 (3LL * 3LL * 3LL * 3LL)
56     if (d != (THREEP4 * THREEP4 * THREEP4 * THREEP4 * THREEP4 * THREEP4
57               * THREEP4))
58       abort ();
59   }
60   if (a != 28 * 7 || b != (1L << 28) || c != 28 * 9)
61     abort ();
62   return 0;