diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pointer_intent_8.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/pointer_intent_8.f90 | 22 |
1 files changed, 22 insertions, 0 deletions
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 |