From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.dg/gomp/pr32468-1.c | 100 ++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/gomp/pr32468-1.c (limited to 'gcc/testsuite/gcc.dg/gomp/pr32468-1.c') diff --git a/gcc/testsuite/gcc.dg/gomp/pr32468-1.c b/gcc/testsuite/gcc.dg/gomp/pr32468-1.c new file mode 100644 index 000000000..437241357 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr32468-1.c @@ -0,0 +1,100 @@ +/* PR libgomp/32468 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -fdump-tree-ompexp" } */ + +extern int printf (const char *, ...); +extern int omp_get_thread_num (void), omp_get_num_threads (void); +extern int bar (void); +extern int baz (const char *, ...); + +void +f1 (void) +{ +#pragma omp parallel + { + baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + #pragma omp sections + { + #pragma omp section + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + #pragma omp section + printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } + } +} + +void +f2 (void) +{ +#pragma omp parallel + { + #pragma omp sections + { + #pragma omp section + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + #pragma omp section + printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } + baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } +} + +void +f3 (void) +{ +#pragma omp parallel + { + int bb = bar (); + #pragma omp sections + { + #pragma omp section + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + #pragma omp section + printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } + } +} + +void +f4 (void) +{ + int i; +#pragma omp parallel + { + baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + #pragma omp for schedule (dynamic, 15) + for (i = 0; i < 10000; i++) + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } +} + +void +f5 (void) +{ + int i; +#pragma omp parallel + { + #pragma omp for schedule (dynamic, 15) + for (i = 0; i < 10000; i++) + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } +} + +void +f6 (void) +{ + int i; +#pragma omp parallel + { + int bb = bar (); + #pragma omp for schedule (runtime) + for (i = 0; i < 10000; i++) + printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ()); + } +} + +/* There should not be a GOMP_parallel_{loop,sections}* call. */ +/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop" 0 "ompexp"} } */ +/* { dg-final { scan-tree-dump-times "GOMP_parallel_sections" 0 "ompexp"} } */ +/* { dg-final { cleanup-tree-dump "ompexp" } } */ -- cgit v1.2.3