summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/block-1.C
blob: d2b86645af8d66eac5214602585cedce9d2c0db2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// { dg-do compile }

void foo()
{
  bad1:				// { dg-error "jump to label" }
  #pragma omp parallel
    goto bad1;			// { dg-error "from here|exits OpenMP" }

  goto bad2;			// { dg-error "from here" }
  #pragma omp parallel
    {
      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
    }

  #pragma omp parallel
    {
      int i;
      goto ok1;
      for (i = 0; i < 10; ++i)
	{ ok1: break; }
    }
}

// { dg-message "error: invalid branch to/from an OpenMP structured block" "" { target *-*-* } 7 }
// { dg-message "error: invalid entry to OpenMP structured block" "" { target *-*-* } 9 }