Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.c / private-1.c
blob10c092a12c60571278e7eaaee495ae4efc1a3ede
1 extern void abort (void);
3 int a = 18;
5 void
6 f1 (int i, int j, int k)
8 int l = 6, m = 7, n = 8;
9 #pragma omp parallel private(j, m) shared(k, n) firstprivate(i, l) \
10 num_threads(1)
12 j = 6;
13 m = 5;
14 if (++a != 19 || ++i != 9 || j != 6 || ++l != 7 || m != 5 || ++n != 9)
15 #pragma omp atomic
16 k++;
18 if (a != 19 || i != 8 || j != 26 || k != 0 || l != 6 || m != 7 || n != 9)
19 abort ();
22 int v1 = 1, v2 = 2, v5 = 5;
23 int e;
25 void
26 f2 (void)
28 int v3 = 3;
29 #pragma omp sections private (v1) firstprivate (v2)
31 #pragma omp section
33 int v4 = 4;
34 v1 = 7;
35 #pragma omp parallel num_threads(1) firstprivate(v1, v2, v3, v4)
37 if (++v1 != 8 || ++v2 != 3 || ++v3 != 4 || ++v4 != 5 || ++v5 != 6)
38 e = 1;
40 if (v1 != 7 || v2 != 2 || v3 != 3 || v4 != 4 || v5 != 6)
41 abort ();
42 if (e)
43 abort ();
48 int
49 main (void)
51 f1 (8, 26, 0);
52 f2 ();
53 return 0;