2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fopenmp -fdump-tree-ompexp" } */
5 extern int printf (const char *, ...);
6 extern int omp_get_thread_num (void), omp_get_num_threads (void);
8 extern int baz (const char *, ...);
15 baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
19 printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
21 printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
34 printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
36 printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
38 baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
51 printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
53 printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
64 baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
65 #pragma omp for schedule (dynamic, 15)
66 for (i
= 0; i
< 10000; i
++)
67 printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
77 #pragma omp for schedule (dynamic, 15)
78 for (i
= 0; i
< 10000; i
++)
79 printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
80 baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
91 #pragma omp for schedule (runtime)
92 for (i
= 0; i
< 10000; i
++)
93 printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
97 /* There should not be a GOMP_parallel_{loop,sections}* call. */
98 /* { dg-final { scan-tree-dump-times "GOMP_parallel_loop" 0 "ompexp"} } */
99 /* { dg-final { scan-tree-dump-times "GOMP_parallel_sections" 0 "ompexp"} } */