PR target/82855
[official-gcc.git] / libgomp / testsuite / libgomp.c / nestedfn-5.c
blob651ce7cf5768a41b2cc679ba0e5b07d43994f69a
1 /* { dg-do run } */
3 extern void abort (void);
5 void
6 foo (int *j)
8 int i = 5;
9 int bar (void) { return i + 1; }
10 #pragma omp sections
12 #pragma omp section
14 if (bar () != 6)
15 #pragma omp atomic
16 ++*j;
18 #pragma omp section
20 if (bar () != 6)
21 #pragma omp atomic
22 ++*j;
27 int
28 main (void)
30 int j = 0;
31 #pragma omp parallel num_threads (2)
32 foo (&j);
33 if (j)
34 abort ();
35 return 0;