diff options
author | Tobias Burnus <burnus@gcc.gnu.org> | 2012-06-18 20:14:06 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-06-18 20:14:06 +0200 |
commit | 284943b0226b75d81e80cc2713cf0e0044a2d21f (patch) | |
tree | 70a2210b90100fcc6896589b6e07b93e1d3d663a /gcc/testsuite | |
parent | 469523083f94ac0729753a9bcdb9fffa038ee02a (diff) | |
download | gcc-284943b0226b75d81e80cc2713cf0e0044a2d21f.zip gcc-284943b0226b75d81e80cc2713cf0e0044a2d21f.tar.gz gcc-284943b0226b75d81e80cc2713cf0e0044a2d21f.tar.bz2 |
re PR fortran/53526 ([Coarray] (lib) Properly handle MOVE_ALLOC for coarrays)
2012-06-18 Tobias Burnus <burnus@net-b.de>
PR fortran/53526
* check.c (gfc_check_move_alloc): Reject coindexed actual
* arguments
and those with different corank.
2012-06-18 Tobias Burnus <burnus@net-b.de>
PR fortran/53526
* gfortran.dg/coarray_27.f90: New.
From-SVN: r188747
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/coarray_27.f90 | 34 |
2 files changed, 41 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5c37425..c1b129a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,7 +1,12 @@ +2012-06-18 Tobias Burnus <burnus@net-b.de> + + PR fortran/53526 + * gfortran.dg/coarray_27.f90: New. + 2012-06-18 Joey Ye <Joey.Ye@arm.com> - Greta Yorsh <Greta.Yorsh@arm.com> + Greta Yorsh <Greta.Yorsh@arm.com> - * gcc.target/arm/epilog-1.c: New test. + * gcc.target/arm/epilog-1.c: New test. 2012-06-18 Richard Guenther <rguenther@suse.de> diff --git a/gcc/testsuite/gfortran.dg/coarray_27.f90 b/gcc/testsuite/gfortran.dg/coarray_27.f90 new file mode 100644 index 0000000..de9cfad --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray_27.f90 @@ -0,0 +1,34 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } +! +! Coarray/coindex checks for MOVE_ALLOC +! +integer, allocatable :: a(:), b(:)[:,:], c(:)[:,:] + +type t + integer, allocatable :: d(:) +end type t +type(t) :: x[*] +class(t), allocatable :: y[:], z[:], u + + +call move_alloc (A, b) ! { dg-error "must have the same corank" } +call move_alloc (c, A) ! { dg-error "must have the same corank" } +call move_alloc (b, c) ! OK - same corank + +call move_alloc (u, y) ! { dg-error "must have the same corank" } +call move_alloc (z, u) ! { dg-error "must have the same corank" } +call move_alloc (y, z) ! OK - same corank + + +call move_alloc (x%d, a) ! OK +call move_alloc (a, x%d) ! OK +call move_alloc (x[1]%d, a) ! { dg-error "The FROM argument to MOVE_ALLOC at .1. shall not be coindexed" } +call move_alloc (a, x[1]%d) ! { dg-error "The TO argument to MOVE_ALLOC at .1. shall not be coindexed" } + +call move_alloc (y%d, a) ! OK +call move_alloc (a, y%d) ! OK +call move_alloc (y[1]%d, a) ! { dg-error "The FROM argument to MOVE_ALLOC at .1. shall not be coindexed" } +call move_alloc (a, y[1]%d) ! { dg-error "The TO argument to MOVE_ALLOC at .1. shall not be coindexed" } + +end |