diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pointer_intent_5.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/pointer_intent_5.f90 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pointer_intent_5.f90 b/gcc/testsuite/gfortran.dg/pointer_intent_5.f90 new file mode 100644 index 000000000..c4e3c7a3c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pointer_intent_5.f90 @@ -0,0 +1,24 @@ +! { dg-do run } +! +! PR 50570: [4.6/4.7 Regression] Incorrect error for assignment to intent(in) pointer +! +! Contributed by Bill Long <longb@cray.com> + +program bots_sparselu_pointer_intent_in + + implicit none + integer, pointer :: array(:) + + allocate(array(4)) + array = 0 + call sub(array) + if (sum(array)/=1) call abort + +contains + + subroutine sub(dummy) + integer, pointer, intent(in) :: dummy(:) + dummy(1) = 1 + end subroutine sub + +end program |