aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-12-19 13:58:32 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2007-12-19 13:58:32 +0100
commit5259c813103b272f141eb5aafc5e473301d58760 (patch)
tree218084fab0c5c9054f254323159ee54c135a9e9c /libgomp
parent5141868dc037e51930341c5508036d5325c07739 (diff)
downloadgcc-5259c813103b272f141eb5aafc5e473301d58760.zip
gcc-5259c813103b272f141eb5aafc5e473301d58760.tar.gz
gcc-5259c813103b272f141eb5aafc5e473301d58760.tar.bz2
re PR c++/34513 (static variable not found for C++ OpenMP)
PR c++/34513 * parser.c (cp_parser_omp_parallel): For non-combined parallel call cp_parser_statement rather than cp_parser_already_scoped_statement. * testsuite/libgomp.c/pr34513.c: New test. * testsuite/libgomp.c++/pr34513.C: New test. From-SVN: r131059
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog6
-rw-r--r--libgomp/testsuite/libgomp.c++/pr34513.C32
-rw-r--r--libgomp/testsuite/libgomp.c/pr34513.c33
3 files changed, 71 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 49b6c54..0ef0abf 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/34513
+ * testsuite/libgomp.c/pr34513.c: New test.
+ * testsuite/libgomp.c++/pr34513.C: New test.
+
2007-12-17 Jack Howarth <howarth@bromo.med.uc.edu>
PR target/32765
diff --git a/libgomp/testsuite/libgomp.c++/pr34513.C b/libgomp/testsuite/libgomp.c++/pr34513.C
new file mode 100644
index 0000000..e5ad3bc
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr34513.C
@@ -0,0 +1,32 @@
+// PR c++/34513
+// { dg-do run }
+
+#include <omp.h>
+
+extern "C" void abort ();
+
+static int errors = 0;
+static int thrs = 4;
+
+int
+main ()
+{
+ omp_set_dynamic (0);
+
+ #pragma omp parallel num_threads (thrs)
+ {
+ static int shrd = 0;
+
+ #pragma omp atomic
+ shrd += 1;
+
+ #pragma omp barrier
+
+ if (shrd != thrs)
+ #pragma omp atomic
+ errors += 1;
+ }
+
+ if (errors)
+ abort ();
+}
diff --git a/libgomp/testsuite/libgomp.c/pr34513.c b/libgomp/testsuite/libgomp.c/pr34513.c
new file mode 100644
index 0000000..76c7ac1
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr34513.c
@@ -0,0 +1,33 @@
+/* PR c++/34513 */
+/* { dg-do run } */
+
+#include <omp.h>
+
+extern void abort ();
+
+static int errors = 0;
+static int thrs = 4;
+
+int
+main ()
+{
+ omp_set_dynamic (0);
+
+ #pragma omp parallel num_threads (thrs)
+ {
+ static int shrd = 0;
+
+ #pragma omp atomic
+ shrd += 1;
+
+ #pragma omp barrier
+
+ if (shrd != thrs)
+ #pragma omp atomic
+ errors += 1;
+ }
+
+ if (errors)
+ abort ();
+ return 0;
+}