[OpenMP, Patch] PR fortran/47886 fix ICE in OMP task's if() clause
Jakub Jelinek
jakub@redhat.com
Sun Feb 27 12:08:00 GMT 2011
On Sat, Feb 26, 2011 at 01:36:13PM -0800, H.J. Lu wrote:
> Shouldn't this testcase be in libgomp?
Sure. Fixed thusly (also made it into a dg-do run testcase),
committed to trunk after regtesting on x86_64-linux and i686-linux:
2011-02-27 Jakub Jelinek <jakub@redhat.com>
PR fortran/47886
* testsuite/libgomp.fortran/task3.f90: New test.
* gfortran.dg/gomp/task-1.f90: Removed.
--- libgomp/testsuite/libgomp.fortran/task3.f90 (revision 0)
+++ libgomp/testsuite/libgomp.fortran/task3.f90 (revision 170535)
@@ -0,0 +1,27 @@
+! { dg-do run }
+! { dg-options "-fopenmp" }
+!
+! PR fortran/47886
+!
+! Test case contributed by Bill Long
+
+! derived from OpenMP test OMP3f/F03_2_7_1d.F90
+program F03_2_7_1d
+ use omp_lib
+ implicit none
+ integer, parameter :: NT = 4
+ integer :: sum = 0
+
+ call omp_set_num_threads(NT);
+
+ !$omp parallel
+ !$omp task if(omp_get_num_threads() > 0)
+ !$omp atomic
+ sum = sum + 1
+ !$omp end task
+ !$omp end parallel
+ if (sum /= NT) then
+ print *, "FAIL - sum == ", sum, " (expected ", NT, ")"
+ call abort
+ end if
+end program F03_2_7_1d
--- gcc/testsuite/gfortran.dg/gomp/task-1.f90 (revision 170534)
+++ gcc/testsuite/gfortran.dg/gomp/task-1.f90 (revision 170535)
@@ -1,27 +0,0 @@
-! { dg-do compile }
-! { dg-options "-fopenmp" }
-!
-! PR fortran/47886
-!
-! Test case contributed by Bill Long
-
-! derived from OpenMP test OMP3f/F03_2_7_1d.F90
-program F03_2_7_1d
- use omp_lib
- implicit none
- integer, parameter :: NT = 4
- integer :: sum = 0
-
- call omp_set_num_threads(NT);
-
- !$omp parallel
- !$omp task if(omp_get_num_threads() > 0)
- !$omp atomic
- sum = sum + 1
- !$omp end task
- !$omp end parallel
- if (sum /= NT) then
- print *, "FAIL - sum == ", sum, " (expected ", NT, ")"
- stop 1;
- end if
-end program F03_2_7_1d
Jakub
More information about the Fortran
mailing list