1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fopenmp -fdump-tree-optimized" } */
3 /* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_ull_start \[^\n\r]*, 3, 1, " 1 "optimized" } } */
4 /* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } } */
5 /* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_ull_nonmonotonic_guided_next " 1 "optimized" } } */
6 /* { dg-final { scan-tree-dump-times "__builtin_GOMP_workshare_task_reduction_unregister \\(0\\)" 1 "optimized" } } */
7 /* { dg-final { scan-tree-dump-times "__builtin_GOMP_parallel " 1 "optimized" } } */
8
9 unsigned long long int j;
10 void bar (unsigned long long int *);
11
12 void
foo(unsigned long long int a,unsigned long long int b,unsigned long long int c)13 foo (unsigned long long int a, unsigned long long int b, unsigned long long int c)
14 {
15 unsigned long long int i;
16 #pragma omp parallel
17 #pragma omp for reduction (task, *: j) schedule (nonmonotonic: guided)
18 for (i = a; i < b; i += c)
19 {
20 j++;
21 bar (&j);
22 }
23 }
24