Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / scope-1.c
blobd2623129288f792d5b5c1d6762215096e7e51f11
1 #ifdef __cplusplus
2 extern "C"
3 #endif
4 void abort ();
6 int
7 main ()
9 int a[64] = {};
10 int r = 0, r2 = 0, i;
11 #pragma omp parallel
13 #pragma omp scope nowait
14 #pragma omp scope nowait
15 #pragma omp for
16 for (i = 0; i < 64; i++)
17 a[i] += 1;
18 #pragma omp scope reduction(+: r) nowait
20 #pragma omp for nowait
21 for (i = 0; i < 64; i++)
23 r += i;
24 if (a[i] != 1)
25 abort ();
27 #pragma omp barrier
29 #pragma omp barrier
30 if (r != 64 * 63 / 2)
31 abort ();
32 #pragma omp scope nowait private (i)
33 #pragma omp scope reduction(+: r2)
35 #pragma omp for nowait
36 for (i = 0; i < 64; i++)
38 r2 += 2 * i;
39 a[i] += i;
42 if (r2 != 64 * 63)
43 abort ();
44 #pragma omp for nowait
45 for (i = 0; i < 64; i++)
46 if (a[i] != i + 1)
47 abort ();
49 return 0;