This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch/gfortran] Fix for PR16939 - the testcase
- From: "Paul Thomas" <paulthomas2 at wanadoo dot fr>
- To: "patch" <gcc-patches at gcc dot gnu dot org>, <fortran at gcc dot gnu dot org>
- Date: Mon, 9 May 2005 22:24:05 +0200
- Subject: [Patch/gfortran] Fix for PR16939 - the testcase
Herewith, the testscase:
! { dg-do run }
! This fixes PR16939, where pointer assignments of scalar,
! character pointers that are dummy arguments did not work.
! Contributed by Paul Thomas pault@gcc.gnu.org
!
program char_pointer_assign_1
character(len=4), pointer :: a
nullify (a)
call foo (a)
if ((.not.associated (a)).or.(a.ne."abcd")) call abort ()
contains
subroutine foo (b)
character(len=4), pointer :: b, c
allocate (c)
c = "abcd"
b => c
end subroutine foo
end program char_pointer_assign_1