diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.dg/gomp/clause-1.c | |
download | cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.tar.bz2 cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.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/gcc.dg/gomp/clause-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/gomp/clause-1.c | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/clause-1.c b/gcc/testsuite/gcc.dg/gomp/clause-1.c new file mode 100644 index 000000000..ace973804 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/clause-1.c @@ -0,0 +1,94 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target tls } */ + +#define p parallel + +extern void bar (void); +extern char q[]; +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" } */ + for (i = 0; i < 10; i++) + ; +#pragma omp p for private (x) lastprivate (x) /* { dg-error "more than" } */ + 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" } */ + ; +#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 "incomplete type" } */ + ; +#pragma omp p firstprivate (q) /* { dg-error "incomplete type" } */ + ; +#pragma omp p for lastprivate (q) /* { dg-error "incomplete type" } */ + 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 'threadpriv" } */ + ; +#pragma omp p for lastprivate (t) /* { dg-error "predetermined 'threadpr" } */ + 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'" } */ + ; +} |