From: Thomas Koenig Date: Sat, 30 Mar 2019 13:41:10 +0000 (+0000) Subject: re PR fortran/89866 ([F08] wrong-code problem with POINTER, INTENT(IN) argument) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c95b82b6172424908142c65a9c5c6d619e9579a;p=gcc.git re PR fortran/89866 ([F08] wrong-code problem with POINTER, INTENT(IN) argument) 2019-03-30 Thomas Koenig PR fortran/89866 * gfortran.dg/pointer_intent_8.f90: New test. From-SVN: r270034 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f5f5bbf24f3..9c583a38e74 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-30 Thomas Koenig + + PR fortran/89866 + * gfortran.dg/pointer_intent_8.f90: New test. + 2019-03-29 Jim Wilson * gcc.target/riscv/predef-1.c: New. diff --git a/gcc/testsuite/gfortran.dg/pointer_intent_8.f90 b/gcc/testsuite/gfortran.dg/pointer_intent_8.f90 new file mode 100644 index 00000000000..6bfbc5c37cc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pointer_intent_8.f90 @@ -0,0 +1,22 @@ +! { dg-do run } +! PR 85797 - this used to get wrong results. + + +PROGRAM testfortran2 + IMPLICIT NONE + + INTEGER, DIMENSION(10), TARGET :: i4array + + i4array = (/ 1,2,3,4,5,6,7,8,9,10 /) + + call InRef(i4array) + +CONTAINS + + subroutine InRef(v) + INTEGER, DIMENSION(:), POINTER, INTENT(in) :: v + INTEGER :: i + if (any (v /= [(i,i=1,10)])) stop 1 + END subroutine + +END