diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/block-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/gomp/block-3.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/block-3.c b/gcc/testsuite/gcc.dg/gomp/block-3.c new file mode 100644 index 00000000000..160047c394c --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/block-3.c @@ -0,0 +1,57 @@ +// { dg-do compile } + +extern int test(int); +void foo() +{ + int i; + + for (i = 0; i < 10; ++i) + { + #pragma omp sections + { + continue; // { dg-error "invalid exit" } + } + } + + #pragma omp sections + { + #pragma omp section + { bad1: ; } + #pragma omp section + goto bad1; // { dg-error "invalid exit" } + } + + #pragma omp sections + { + goto bad2; // { dg-error "invalid exit" } + } + bad2:; + + goto bad3; // { dg-error "invalid entry" } + #pragma omp sections + { + bad3: ; + } + + #pragma omp sections + { + goto ok1; + ok1:; + + #pragma omp section + for (i = 0; i < 10; ++i) + if (test(i)) + break; + else + continue; + + #pragma omp section + switch (i) + { + case 0: + break; + default: + test(i); + } + } +} |