(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
gomp/
teams-1.c
       1  /* { dg-do compile } */
       2  
       3  void
       4  foo (int x)
       5  {
       6    bad1:
       7    #pragma omp target teams
       8      goto bad1; // { dg-error "invalid branch to/from OpenMP structured block" }
       9  
      10    goto bad2; // { dg-error "invalid entry to OpenMP structured block" }
      11    #pragma omp target teams
      12      {
      13        bad2: ;
      14      }
      15  
      16    #pragma omp target teams
      17      {
      18        int i;
      19        goto ok1;
      20        for (i = 0; i < 10; ++i)
      21  	{ ok1: break; }
      22      }
      23  
      24    switch (x) // { dg-error "invalid entry to OpenMP structured block" }
      25    {
      26    #pragma omp target teams // { dg-warning "statement will never be executed" }
      27      { case 0:; }
      28    }
      29  }
      30  
      31  void
      32  bar (int x)
      33  {
      34    bad1:
      35    #pragma omp target
      36    #pragma omp teams
      37      goto bad1; // { dg-error "invalid branch to/from OpenMP structured block" }
      38  
      39    goto bad2; // { dg-error "invalid entry to OpenMP structured block" }
      40    #pragma omp target
      41    #pragma omp teams
      42      {
      43        bad2: ;
      44      }
      45  
      46    #pragma omp target
      47    #pragma omp teams
      48      {
      49        int i;
      50        goto ok1;
      51        for (i = 0; i < 10; ++i)
      52  	{ ok1: break; }
      53      }
      54  
      55    switch (x) // { dg-error "invalid entry to OpenMP structured block" }
      56    {
      57    #pragma omp target // { dg-warning "statement will never be executed" }
      58    #pragma omp teams
      59      { case 0:; }
      60    }
      61  }