diff options
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++) + ; +} |