This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gomp] Fix omp_parse3.f90 test
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 25 Oct 2007 16:48:03 -0400
- Subject: [gomp] Fix omp_parse3.f90 test
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This test had 2 bugs in it, only the latter actually being the cause for
intermittent failures.
j was shared by accident, so if multiple threads were running at the same
time the test could abort. Also, x and y used the implicit real type,
eventhough in MAIN__ it is integer (but as integer and real are typically
the same size, this wasn't a big deal).
Committed to trunk.
2007-10-25 Jakub Jelinek <jakub@redhat.com>
PR libgomp/33275
* testsuite/libgomp.fortran/omp_parse3.f90 (test_threadprivate):
Make x and y integers rather than (implicit) reals. Add private (j)
clause to the last omp parallel.
--- libgomp/testsuite/libgomp.fortran/omp_parse3.f90 (revision 129519)
+++ libgomp/testsuite/libgomp.fortran/omp_parse3.f90 (working copy)
@@ -55,7 +55,7 @@ contains
subroutine test_threadprivate
common /tlsblock/ x, y
!$omp threadprivate (/tlsblock/)
- integer :: i, j
+ integer :: i, j, x, y
logical :: m, n
call omp_set_num_threads (4)
call omp_set_dynamic (.false.)
@@ -83,7 +83,8 @@ contains
!$omp end parallel
m = m .or. n
n = .false.
-!$omp parallel num_threads (4), copyin (z) reduction (.or. : n)
+!$omp parallel num_threads (4), copyin (z) reduction (.or. : n) &
+!$omp&private (j)
if (z .ne. 4096) n = .true.
if (omp_get_num_threads () .eq. i) then
j = omp_get_thread_num ()
Jakub