summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/clause-3.C
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.dg/gomp/clause-3.C
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.dg/gomp/clause-3.C')
-rw-r--r--gcc/testsuite/g++.dg/gomp/clause-3.C94
1 files changed, 94 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/gomp/clause-3.C b/gcc/testsuite/g++.dg/gomp/clause-3.C
new file mode 100644
index 000000000..6b3d410a9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/clause-3.C
@@ -0,0 +1,94 @@
+// { dg-do compile }
+// { dg-require-effective-target tls }
+
+#define p parallel
+
+extern void bar (void);
+extern char q[]; // { dg-error "has incomplete type" }
+int t;
+#pragma omp threadprivate (t)
+
+void
+foo (int x)
+{
+ char *p;
+ struct S { int i; int j; } s;
+ char a[32];
+ double d;
+ int i;
+ const int c = 8;
+#pragma omp p shared (x, x) // { dg-error "more than once" }
+ ;
+#pragma omp p private (x) private (x) // { dg-error "more than once" }
+ ;
+#pragma omp p shared (x) firstprivate (x) // { dg-error "more than once" }
+ ;
+#pragma omp p firstprivate (x, x) // { dg-error "more than once" }
+ ;
+#pragma omp p for shared (x) lastprivate (x) // { dg-error "more than once" }
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p for private (x) lastprivate (x) // { dg-error "more than once" }
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p for lastprivate (x, x) // { dg-error "more than once" }
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp single private (x) copyprivate (x) // { dg-error "more than once" }
+ ;
+#pragma omp p shared (bar) // { dg-error "is not a variable" }
+ ;
+#pragma omp p private (bar) // { dg-error "is not a variable" }
+ ;
+#pragma omp p firstprivate (bar) // { dg-error "is not a variable" }
+ ;
+#pragma omp p reduction (+:p) // { dg-error "has invalid type for" }
+ ;
+#pragma omp p reduction (*:s) // { dg-error "has invalid type for" }
+ ;
+#pragma omp p reduction (-:a) // { dg-error "has invalid type for" }
+ ;
+ d = 0;
+#pragma omp p reduction (*:d)
+ ;
+#pragma omp p reduction (|:d) // { dg-error "has invalid type for" }
+ ;
+#pragma omp p reduction (&&:d) // { dg-error "has invalid type for" }
+ ;
+#pragma omp p copyin (d) // { dg-error "must be 'threadprivate'" }
+ ;
+#pragma omp p copyin (x) // { dg-error "must be 'threadprivate'" }
+ ;
+#pragma omp p for firstprivate (x) lastprivate (x)
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p private (q) // { dg-error "unspecified bounds" }
+ ;
+#pragma omp p firstprivate (q) // { dg-error "unspecified bounds" }
+ ;
+#pragma omp p for lastprivate (q) // { dg-error "unspecified bounds" }
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p shared (t) // { dg-error "predetermined 'threadprivate'" }
+ ;
+#pragma omp p private (t) // { dg-error "predetermined 'threadprivate'" }
+ ;
+#pragma omp p firstprivate (t) // { dg-error "predetermined 'threadprivate'" }
+ ;
+#pragma omp p for lastprivate (t) // { dg-error "predetermined 'threadpriv" }
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p reduction (*:t) // { dg-error "predetermined 'threadprivate'" }
+ ;
+#pragma omp p shared (c) // { dg-error "predetermined 'shared'" }
+ ;
+#pragma omp p private (c) // { dg-error "predetermined 'shared'" }
+ ;
+#pragma omp p firstprivate (c) // { dg-error "predetermined 'shared'" }
+ ;
+#pragma omp p for lastprivate (c) // { dg-error "predetermined 'shared'" }
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p reduction (*:c) // { dg-error "predetermined 'shared'" }
+ ;
+}