diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump.c b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump.c new file mode 100644 index 000000000..9ec3293cc --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump.c @@ -0,0 +1,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 a Cilk" } */ + } +} + +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" } */ +} |