[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / gomp / block-3.C
blob753c19b5cfa7a4bd564ed75418da4f0a46e443cc
1 // { dg-do compile }
3 extern int test(int);
4 void foo()
6   int i;
8   for (i = 0; i < 10; ++i)
9     {
10       #pragma omp sections
11       {
12         continue;               // { dg-error "invalid exit" }
13       }
14     }
16   #pragma omp sections
17     {
18     #pragma omp section
19       { bad1: ; }               // { dg-error "jump to label" }
20     #pragma omp section
21       goto bad1;                // { dg-message "from here|enters OpenMP" }
22     }
24   #pragma omp sections
25     {
26       goto bad2;                // { dg-message "from here" }
27     }
28   bad2:;                        // { dg-error "jump" }
29                                 // { dg-message "exits OpenMP" "" { target *-*-* } .-1 }
31   goto bad3;                    // { dg-message "from here" }
32   #pragma omp sections
33     {
34       bad3: ;                   // { dg-error "jump" }
35                                 // { dg-message "enters OpenMP" "" { target *-*-* } .-1 }
36     }
38   #pragma omp sections
39     {
40       {
41         goto ok1;
42         ok1:;
43       }
45     #pragma omp section
46       for (i = 0; i < 10; ++i)
47         if (test(i))
48           break;
49         else
50           continue;
52     #pragma omp section
53       switch (i)
54         {
55         case 0:
56           break;
57         default:
58           test(i);
59         }
60     }
63 // { dg-message "error: invalid branch to/from OpenMP structured block" "" { target *-*-* } 21 }
64 // { dg-message "error: invalid branch to/from OpenMP structured block" "" { target *-*-* } 26 }
65 // { dg-message "error: invalid entry to OpenMP structured block" "" { target *-*-* } 31 }