From a03890ea9d7d79ff93e5be4afc17df782535cf90 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Sun, 18 Nov 2007 20:59:41 +0000 Subject: [PATCH] re PR fortran/33317 (CSHIFT/EOSHIFT: Rejects optional dummy for DIM=) 2007-11-18 Jerry DeLisle PR fortran/33317 * gfortran.dg/optional_dim_2.f90: New test. PR fortran/34139 * gfortran.dg/subref_array_pointer_2.f90: Update test condition. From-SVN: r130277 --- gcc/testsuite/ChangeLog | 8 +++++++ gcc/testsuite/gfortran.dg/optional_dim_2.f90 | 24 +++++++++++++++++++ .../gfortran.dg/subref_array_pointer_2.f90 | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/optional_dim_2.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cf4759f897d..d25d6119190 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2007-11-18 Jerry DeLisle + + PR fortran/33317 + * gfortran.dg/optional_dim_2.f90: New test. + + PR fortran/34139 + * gfortran.dg/subref_array_pointer_2.f90: Update test condition. + 2007-11-18 Jakub Jelinek PR rtl-optimization/34132 diff --git a/gcc/testsuite/gfortran.dg/optional_dim_2.f90 b/gcc/testsuite/gfortran.dg/optional_dim_2.f90 new file mode 100644 index 00000000000..a1ab4c7aa23 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/optional_dim_2.f90 @@ -0,0 +1,24 @@ +! { dg-do run } +! PR33317 CSHIFT/EOSHIFT: Rejects optional dummy for DIM= +! Test case submitted by Jerry DeLisle +program test + implicit none + call sub(bound=(/.false.,.true.,.true.,.true./), dimmy=1_8) + call sub() +contains + subroutine sub(bound, dimmy) + integer(kind=8), optional :: dimmy + logical, optional :: bound(4) + logical :: lotto(4) + character(20) :: testbuf + lotto = .false. + lotto = cshift((/.true.,.false.,.true.,.false./),1,dim=dimmy) + write(testbuf,*) lotto + if (trim(testbuf).ne." F T F T") call abort + lotto = .false. + lotto = eoshift((/.true.,.true.,.true.,.true./),1,boundary=bound,dim=dimmy) + lotto = eoshift(lotto,1,dim=dimmy) + write(testbuf,*) lotto + if (trim(testbuf).ne." T T F F") print *, testbuf + end subroutine +end program test diff --git a/gcc/testsuite/gfortran.dg/subref_array_pointer_2.f90 b/gcc/testsuite/gfortran.dg/subref_array_pointer_2.f90 index 97aabf1e160..e96d75507d9 100644 --- a/gcc/testsuite/gfortran.dg/subref_array_pointer_2.f90 +++ b/gcc/testsuite/gfortran.dg/subref_array_pointer_2.f90 @@ -81,7 +81,7 @@ tar3%t => tar1 ptr3 => tar3%t%r ptr3 = cos (ptr3) - if (any (ptr3 .ne. (/cos(1.0_4), cos(3.0_4)/))) call abort () + if (any (abs(ptr3 - (/cos(1.0_4), cos(3.0_4)/)) >= epsilon(1.0_4))) call abort () ptr2 => tar3%t(:)%chr(2:3) ptr2 = " x" -- 2.30.2