summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-19 10:16:29 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-19 10:16:29 +0000
commit927fed673cd9d27db9f46cde6d485e862113f8bd (patch)
treedc0a25a9c498538bfe63c0c459f285b3d6871de5 /gcc/testsuite
parenta46a7e429e2bd775f1eb8c34bf7d6ccd58eafdfa (diff)
downloadgcc-927fed673cd9d27db9f46cde6d485e862113f8bd.tar.gz
PR c++/34964
PR c++/35244 * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p vars. Afterwards ensure v is VAR_DECL. * gcc.dg/gomp/pr34964.c: New test. * g++.dg/gomp/pr34964.C: New test. * gcc.dg/gomp/pr35244.c: New test. * g++.dg/gomp/pr35244.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132425 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr34964.C6
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr35244.C30
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr34964.c6
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr35244.c20
5 files changed, 69 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e25dfc9050a..b5ab00f0b67 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2008-02-19 Jakub Jelinek <jakub@redhat.com>
+ PR c++/34964
+ PR c++/35244
+ * gcc.dg/gomp/pr34964.c: New test.
+ * g++.dg/gomp/pr34964.C: New test.
+ * gcc.dg/gomp/pr35244.c: New test.
+ * g++.dg/gomp/pr35244.C: New test.
+
PR c++/35078
* g++.dg/gomp/pr35078.C: New test.
diff --git a/gcc/testsuite/g++.dg/gomp/pr34964.C b/gcc/testsuite/g++.dg/gomp/pr34964.C
new file mode 100644
index 00000000000..f5995a6da91
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr34964.C
@@ -0,0 +1,6 @@
+// PR c++/34964
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+char x[] = 0; // { dg-error "initializer fails to determine size" }
+#pragma omp threadprivate (x)
diff --git a/gcc/testsuite/g++.dg/gomp/pr35244.C b/gcc/testsuite/g++.dg/gomp/pr35244.C
new file mode 100644
index 00000000000..189df1eb26e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr35244.C
@@ -0,0 +1,30 @@
+// PR c++/35244
+// { dg-do compile }
+// { dg-require-effective-target tls_native }
+// { dg-options "-fopenmp" }
+
+int v1;
+namespace N1
+{
+ int v2;
+}
+namespace N2
+{
+ int v3;
+}
+using N1::v2;
+using namespace N2;
+struct A;
+typedef int i;
+#pragma omp threadprivate (i) // { dg-error "is not file, namespace or block scope variable" }
+#pragma omp threadprivate (A) // { dg-error "is not file, namespace or block scope variable" }
+#pragma omp threadprivate (v1, v2, v3)
+
+void foo ()
+{
+ static int v4;
+ {
+ static int v5;
+#pragma omp threadprivate (v4, v5)
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/pr34964.c b/gcc/testsuite/gcc.dg/gomp/pr34964.c
new file mode 100644
index 00000000000..7800be1d5cc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr34964.c
@@ -0,0 +1,6 @@
+/* PR c++/34964 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+char x[] = 0; /* { dg-error "invalid initializer" } */
+#pragma omp threadprivate (x)
diff --git a/gcc/testsuite/gcc.dg/gomp/pr35244.c b/gcc/testsuite/gcc.dg/gomp/pr35244.c
new file mode 100644
index 00000000000..aa19a18bb25
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr35244.c
@@ -0,0 +1,20 @@
+/* PR c++/35244 */
+/* { dg-do compile } */
+/* { dg-require-effective-target tls_native } */
+/* { dg-options "-fopenmp" } */
+
+int v1;
+typedef struct A A;
+typedef int i;
+#pragma omp threadprivate (i) /* { dg-error "expected identifier before" } */
+#pragma omp threadprivate (A) /* { dg-error "expected identifier before" } */
+#pragma omp threadprivate (v1)
+
+void foo ()
+{
+ static int v4;
+ {
+ static int v5;
+#pragma omp threadprivate (v4, v5)
+ }
+}