1 // { dg-do compile }
2 
3 extern int test(int);
foo()4 void foo()
5 {
6   int i;
7 
8   for (i = 0; i < 10; ++i)
9     {
10       #pragma omp sections
11       {
12 	continue; // { dg-error "invalid branch to/from OpenMP structured block" }
13       }
14     }
15 
16   #pragma omp sections
17     {
18     #pragma omp section
19       { bad1: ; }
20     #pragma omp section
21       goto bad1; // { dg-error "invalid branch to/from OpenMP structured block" }
22     }
23 
24   #pragma omp sections
25     {
26       goto bad2; // { dg-error "invalid branch to/from OpenMP structured block" }
27     }
28   bad2:;
29 
30   goto bad3; // { dg-error "invalid entry to OpenMP structured block" }
31   #pragma omp sections
32     {
33       bad3: ;
34     }
35 
36   #pragma omp sections
37     {
38       {
39 	goto ok1;
40 	ok1:;
41       }
42     #pragma omp section
43       for (i = 0; i < 10; ++i)
44 	if (test(i))
45 	  break;
46 	else
47 	  continue;
48 
49     #pragma omp section
50       switch (i)
51 	{
52 	case 0:
53 	  break;
54 	default:
55 	  test(i);
56 	}
57     }
58 }
59