summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/block-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/block-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/block-2.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/block-2.c b/gcc/testsuite/gcc.dg/gomp/block-2.c
new file mode 100644
index 00000000000..810b2da07b4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/block-2.c
@@ -0,0 +1,32 @@
+// { dg-do compile }
+
+void foo()
+{
+ int i, j;
+
+ #pragma omp for
+ for (i = 0; i < 10; ++i)
+ break; // { dg-error "break" }
+
+ bad1:
+ #pragma omp for
+ for (i = 0; i < 10; ++i)
+ goto bad1; // { dg-error "invalid exit" }
+
+ goto bad2; // { dg-error "invalid entry" }
+ #pragma omp for
+ for (i = 0; i < 10; ++i)
+ {
+ bad2: ;
+ }
+
+ #pragma omp for
+ for (i = 0; i < 10; ++i)
+ for (j = 0; j < 10; ++j)
+ if (i == j)
+ break;
+
+ #pragma omp for
+ for (i = 0; i < 10; ++i)
+ continue;
+}