diff options
author | Andre Vehreschild <vehre@gcc.gnu.org> | 2016-10-01 16:00:57 +0200 |
---|---|---|
committer | Andre Vehreschild <vehre@gcc.gnu.org> | 2016-10-01 16:00:57 +0200 |
commit | 0f0565b1438c82118f1f31f6880c509c472c3bf5 (patch) | |
tree | eff176f1e251fa98b5827cd362cc3acbcca23c7a /gcc | |
parent | eb647b80ba1a0ab2d9b879cbfdd08cd6805e75c3 (diff) | |
download | gcc-0f0565b1438c82118f1f31f6880c509c472c3bf5.zip gcc-0f0565b1438c82118f1f31f6880c509c472c3bf5.tar.gz gcc-0f0565b1438c82118f1f31f6880c509c472c3bf5.tar.bz2 |
re PR libfortran/77663 (libgfortran/caf/single.c: three minor problems and a lost token)
gcc/testsuite/ChangeLog:
2016-10-01 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/77663
* gfortran.dg/coarray_send_by_ref_1.f08: New test.
libgfortran/ChangeLog:
2016-10-01 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/77663
* caf/single.c (caf_internal_error): Fix not terminating va-list.
(_gfortran_caf_register): Free memory also when other allocs failed.
(_gfortran_caf_get_by_ref): Fixed style.
(send_by_ref): Token is now stored at the correct position preventing
inaccessible tokens, memory loss and possibly crashes.
From-SVN: r240695
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/coarray_send_by_ref_1.f08 | 29 |
2 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d19b03f..feb7877 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-10-01 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/77663 + * gfortran.dg/coarray_send_by_ref_1.f08: New test. + 2016-10-01 Jakub Jelinek <jakub@redhat.com> PR c/77490 diff --git a/gcc/testsuite/gfortran.dg/coarray_send_by_ref_1.f08 b/gcc/testsuite/gfortran.dg/coarray_send_by_ref_1.f08 new file mode 100644 index 0000000..73f91e0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray_send_by_ref_1.f08 @@ -0,0 +1,29 @@ +! { dg-do run } +! { dg-options "-fcoarray=lib -lcaf_single" } + +program check_caf_send_by_ref + + implicit none + + type T + integer, allocatable :: scal + integer, allocatable :: array(:) + end type T + + type(T), save :: obj[*] + integer :: me, np, i + + me = this_image() + np = num_images() + + obj[np]%scal = 42 + + ! Check the token for the scalar is set. + if (obj[np]%scal /= 42) call abort() + + ! Now the same for arrays. + obj[np]%array = [(i * np + me, i = 1, 15)] + if (any(obj[np]%array /= [(i * np + me, i = 1, 15)])) call abort() + +end program check_caf_send_by_ref + |