diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-06-09 23:18:42 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2006-06-09 23:18:42 +0200 |
commit | cd75853e1d1279a99afc0e5dc46b30edca64e6f4 (patch) | |
tree | 530c2e857eb28361de2db9d88b30a1ef04da4efb /libgomp | |
parent | 1c90c6f9c03360da9f6b01ef0ec28e309a0bb892 (diff) | |
download | gcc-cd75853e1d1279a99afc0e5dc46b30edca64e6f4.zip gcc-cd75853e1d1279a99afc0e5dc46b30edca64e6f4.tar.gz gcc-cd75853e1d1279a99afc0e5dc46b30edca64e6f4.tar.bz2 |
re PR fortran/27916 (Problem with allocatable arrays inside OpenMP do loop)
PR fortran/27916
* trans-openmp.c (gfc_omp_clause_default_ctor): New function.
* trans.h (gfc_omp_clause_default_ctor): New prototype.
* f95-lang.c (LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR): Define.
* testsuite/libgomp.fortran/pr27916-1.f90: New test.
* testsuite/libgomp.fortran/pr27916-2.f90: New test.
From-SVN: r114520
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 6 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/pr27916-1.f90 | 26 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/pr27916-2.f90 | 26 |
3 files changed, 58 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 8ce2c1a..07d0ff3 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,9 @@ +2006-06-09 Jakub Jelinek <jakub@redhat.com> + + PR fortran/27916 + * testsuite/libgomp.fortran/pr27916-1.f90: New test. + * testsuite/libgomp.fortran/pr27916-2.f90: New test. + 2006-06-06 Francois-Xavier Coudert <coudert@clipper.ens.fr> * config/mingw32/time.c: New file. diff --git a/libgomp/testsuite/libgomp.fortran/pr27916-1.f90 b/libgomp/testsuite/libgomp.fortran/pr27916-1.f90 new file mode 100644 index 0000000..7f6b51d --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/pr27916-1.f90 @@ -0,0 +1,26 @@ +! PR fortran/27916 +! Test whether allocatable privatized arrays has "not currently allocated" +! status at the start of OpenMP constructs. +! { dg-do run } + +program pr27916 + integer :: n, i + logical :: r + integer, dimension(:), allocatable :: a + + r = .false. +!$omp parallel do num_threads (4) private (n, a, i) & +!$omp & reduction (.or.: r) schedule (static) + do n = 1, 16 + r = r .or. allocated (a) + allocate (a (16)) + r = r .or. .not. allocated (a) + do i = 1, 16 + a (i) = i + end do + deallocate (a) + r = r .or. allocated (a) + end do + !$omp end parallel do + if (r) call abort +end program pr27916 diff --git a/libgomp/testsuite/libgomp.fortran/pr27916-2.f90 b/libgomp/testsuite/libgomp.fortran/pr27916-2.f90 new file mode 100644 index 0000000..aa8bb0a --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/pr27916-2.f90 @@ -0,0 +1,26 @@ +! PR fortran/27916 +! Test whether allocatable privatized arrays has "not currently allocated" +! status at the start of OpenMP constructs. +! { dg-do run } + +program pr27916 + integer :: n, i + logical :: r + integer, dimension(:), allocatable :: a + + r = .false. +!$omp parallel do num_threads (4) default (private) & +!$omp & reduction (.or.: r) schedule (static) + do n = 1, 16 + r = r .or. allocated (a) + allocate (a (16)) + r = r .or. .not. allocated (a) + do i = 1, 16 + a (i) = i + end do + deallocate (a) + r = r .or. allocated (a) + end do + !$omp end parallel do + if (r) call abort +end program pr27916 |