diff options
Diffstat (limited to 'gcc-4.8.1/gcc/testsuite/g++.dg/gomp/pr29965-9.C')
-rw-r--r-- | gcc-4.8.1/gcc/testsuite/g++.dg/gomp/pr29965-9.C | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc-4.8.1/gcc/testsuite/g++.dg/gomp/pr29965-9.C b/gcc-4.8.1/gcc/testsuite/g++.dg/gomp/pr29965-9.C new file mode 100644 index 000000000..b66a24729 --- /dev/null +++ b/gcc-4.8.1/gcc/testsuite/g++.dg/gomp/pr29965-9.C @@ -0,0 +1,34 @@ +// PR middle-end/29965 +// Test that OpenMP construct bodies which never return don't cause ICEs. +// This is invalid code, but we don't emit diagnostics for it, nevertheless +// we test that we don't ICE on it. +// { dg-do compile } +// { dg-options "-O2 -fopenmp" } + +void +foo1 () +{ +#pragma omp single + throw 0; +} + +void +foo2 () +{ +#pragma omp master + throw 0; +} + +void +foo3 () +{ +#pragma omp ordered + throw 0; +} + +void +foo4 () +{ +#pragma omp critical + throw 0; +} |