aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c
new file mode 100644
index 000000000..95e6b2d44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus -fopenmp" } */
+/* { dg-require-effective-target fopenmp } */
+
+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 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" } */
+}
+
+void baz()
+{
+ bad1:
+ #pragma omp parallel
+ goto bad1; /* { dg-error "invalid branch to/from an OpenMP structured block" } */
+
+ goto bad2; /* { dg-error "invalid entry to OpenMP structured block" } */
+ #pragma omp parallel
+ {
+ bad2: ;
+ }
+
+ #pragma omp parallel
+ {
+ int i;
+ goto ok1;
+ for (i = 0; i < 10; ++i)
+ { ok1: break; }
+ }
+}