summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/reduction-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/reduction-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/reduction-2.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/reduction-2.c b/gcc/testsuite/gcc.dg/gomp/reduction-2.c
new file mode 100644
index 00000000000..f8ac8b6bbfe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/reduction-2.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+struct S {};
+void foo (void *, void *);
+void bar (void *, void *);
+void baz (void *);
+#pragma omp declare reduction(+:struct S:foo (&omp_out, &omp_in))initializer(bar(&omp_priv, &omp_orig))
+
+void
+test1 (void)
+{
+ struct S s;
+ int i;
+ #pragma omp parallel reduction(+:s)
+ baz (&s);
+ #pragma omp parallel reduction(task, +:s) /* { dg-error "zero sized type 'struct S' in 'reduction' clause" } */
+ baz (&s);
+ #pragma omp taskloop reduction(+:s) /* { dg-error "zero sized type 'struct S' in 'reduction' clause" } */
+ for (i = 0; i < 1; i++)
+ baz (&s);
+ #pragma omp taskloop simd reduction(+:s) /* { dg-error "zero sized type 'struct S' in 'reduction' clause" } */
+ for (i = 0; i < 1; i++)
+ baz (&s);
+ #pragma omp taskgroup task_reduction(+:s) /* { dg-error "zero sized type 'struct S' in 'task_reduction' clause" } */
+ {
+ #pragma omp task in_reduction(+:s) /* { dg-error "zero sized type 'struct S' in 'in_reduction' clause" } */
+ baz (&s);
+ }
+}