diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-17 08:35:01 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-17 08:35:01 +0000 |
commit | 87f7c31ef783d27c635cec533ca1d67789096966 (patch) | |
tree | 7de49861b990eff224e646e29a3ad1dd59004468 /gcc/testsuite/gcc.dg/gomp | |
parent | 93c1299472e04fceb734d53cb35bc76e1586bc66 (diff) | |
download | gcc-87f7c31ef783d27c635cec533ca1d67789096966.tar.gz |
PR middle-end/27415
* tree.h (OMP_PARALLEL_COMBINED): Define.
* gimplify.c (struct gimplify_omp_ctx): Add is_combined_parallel field.
(new_omp_context): Add is_combined_parallel argument.
(gimplify_scan_omp_clauses): Add in_combined_parallel argument, adjust
new_omp_context caller.
(gimplify_omp_parallel, gimplify_omp_for, gimplify_omp_workshare):
Adjust gimplify_scan_omp_clauses callers.
(omp_is_private): Issue errors if iteration variable is firstprivate
or reduction in the current context.
* c-parser.c (c_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
on combined parallel workshare constructs.
cp/
* parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
on combined parallel workshare constructs.
* pt.c (tsubst_expr): Copy OMP_PARALLEL_COMBINED flag.
fortran/
* trans-openmp.c (gfc_trans_omp_parallel_do,
gfc_trans_omp_parallel_sections, gfc_trans_omp_parallel_workshare): Set
OMP_PARALLEL_COMBINED flag.
testsuite/
* gcc.dg/gomp/pr27415.c: New test.
* g++.dg/gomp/pr27415.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113846 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp')
-rw-r--r-- | gcc/testsuite/gcc.dg/gomp/pr27415.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/pr27415.c b/gcc/testsuite/gcc.dg/gomp/pr27415.c new file mode 100644 index 00000000000..418eaf678e9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr27415.c @@ -0,0 +1,50 @@ +/* PR middle-end/27415 */ +/* { dg-do compile } */ + +void +test1 (void) +{ + int i = 0; +#pragma omp parallel +#pragma omp for firstprivate (i) /* { dg-error "should not be firstprivate" } */ + for (i = 0; i < 10; i++) + ; +} + +void +test2 (void) +{ + int i = 0; +#pragma omp parallel for firstprivate (i) + for (i = 0; i < 10; i++) /* { dg-error "should not be firstprivate" } */ + ; +} + +void +test3 (void) +{ + int i = 0; +#pragma omp parallel +#pragma omp for reduction (+:i) /* { dg-error "should not be reduction" } */ + for (i = 0; i < 10; i++) + ; +} + +void +test4 (void) +{ + int i = 0; +#pragma omp parallel for reduction (*:i) + for (i = 0; i < 10; i++) /* { dg-error "should not be reduction" } */ + ; +} + +void +test5 (void) +{ + int i = 0; +#pragma omp parallel firstprivate (i) +#pragma omp for + for (i = 0; i < 10; i++) + ; +} |