Merge from mainline
[official-gcc.git] / gcc / testsuite / gcc.dg / gomp / block-3.c
blob160047c394cb263021a8c839f2b41b25a0aaccfc
1 // { dg-do compile }
3 extern int test(int);
4 void foo()
6 int i;
8 for (i = 0; i < 10; ++i)
10 #pragma omp sections
12 continue; // { dg-error "invalid exit" }
16 #pragma omp sections
18 #pragma omp section
19 { bad1: ; }
20 #pragma omp section
21 goto bad1; // { dg-error "invalid exit" }
24 #pragma omp sections
26 goto bad2; // { dg-error "invalid exit" }
28 bad2:;
30 goto bad3; // { dg-error "invalid entry" }
31 #pragma omp sections
33 bad3: ;
36 #pragma omp sections
38 goto ok1;
39 ok1:;
41 #pragma omp section
42 for (i = 0; i < 10; ++i)
43 if (test(i))
44 break;
45 else
46 continue;
48 #pragma omp section
49 switch (i)
51 case 0:
52 break;
53 default:
54 test(i);