This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]