aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cilk-plus/jump.c
blob: 1ca886a645f2aa4d51b61fdd8fbdf4748ffe394b (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
26
27
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */

int *a, *b, c;

void foo()
{
#pragma simd
  for (int i=0; i < 1000; ++i)
    {
      a[i] = b[i];
      if (c == 5)
	return; /* { dg-error "invalid branch to/from Cilk Plus structured block" } */
    }
}

void bar()
{
#pragma simd
  for (int i=0; i < 1000; ++i)
    {
    lab:
      a[i] = b[i];
    }
  if (c == 6)
    goto lab; /* { dg-error "invalid entry to Cilk Plus structured block" } */
}