diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/workshare-reduction-39.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/gomp/workshare-reduction-39.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/workshare-reduction-39.c b/gcc/testsuite/gcc.dg/gomp/workshare-reduction-39.c new file mode 100644 index 0000000..b5996e0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/workshare-reduction-39.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_ull_start \[^\n\r]*, 2, 3, " 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_ull_nonmonotonic_dynamic_next " 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_GOMP_workshare_task_reduction_unregister \\(0\\)" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "__builtin_GOMP_parallel " 1 "optimized" } } */ + +unsigned long long int j; +void bar (unsigned long long int *); + +void +foo (unsigned long long int a, unsigned long long int b, unsigned long long int c) +{ + unsigned long long int i; + #pragma omp parallel + #pragma omp for reduction (task, *: j) schedule (dynamic, 3) + for (i = a; i < b; i += c) + { + j++; + bar (&j); + } +} |