Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / task-reduction-1.c
blob6c6191d96d59770e35a2690f4e8319d273d1a6af
1 #ifdef __cplusplus
2 extern "C"
3 #endif
4 void abort (void);
6 int a;
7 long int b = 1;
9 void
10 foo (void)
12 int i;
13 for (i = 0; i < 2; i++)
14 #pragma omp task in_reduction (+: a) in_reduction (*: b)
16 a += 7;
17 b *= 2;
21 int
22 main ()
24 int c = 0;
25 #pragma omp parallel
26 #pragma omp single
28 long int d = 1;
29 #pragma omp taskgroup task_reduction (+: a, c) task_reduction (*: b, d)
31 int i;
32 for (i = 0; i < 4; i++)
33 #pragma omp task in_reduction (+: a, c) in_reduction (*: b, d)
35 int j;
36 a += 7;
37 b *= 2;
38 for (j = 0; j < 2; j++)
39 #pragma omp task in_reduction (+: a, c) in_reduction (*: b, d)
41 a += 7;
42 b *= 2;
43 c += 9;
44 d *= 3;
45 foo ();
47 c += 9;
48 d *= 3;
51 #define THREEP4 (3L * 3L * 3L * 3L)
52 if (d != (THREEP4 * THREEP4 * THREEP4))
53 abort ();
55 if (a != 28 * 7 || b != (1L << 28) || c != 12 * 9)
56 abort ();
57 return 0;