summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/sections-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/sections-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/sections-2.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/sections-2.c b/gcc/testsuite/gcc.dg/gomp/sections-2.c
new file mode 100644
index 00000000000..aabdfaf8069
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/sections-2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+extern void bar(int);
+void foo(void)
+{
+ #pragma omp sections
+ bar (0); // { dg-error "expected" }
+
+ #pragma omp sections
+ {
+ } // { dg-error "expected" }
+
+ #pragma omp sections
+ {
+ bar (1);
+ }
+
+ #pragma omp sections
+ {
+ #pragma omp section
+ bar(2);
+ bar(3); // { dg-error "expected" }
+ bar(4);
+ #pragma omp section
+ bar(5);
+ bar(6); // { dg-error "expected" }
+ bar(7);
+ }
+}