This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, testsuite] PR19181 - new test
- 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'" <fortran at gcc dot gnu dot org>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Sun, 18 Sep 2005 11:16:42 +0200
- Subject: [Patch, testsuite] PR19181 - new test
- References: <432BDA19.3060301@wanadoo.fr> <20050917142053.GA33182@troutmask.apl.washington.edu> <432C4C6E.5030209@wanadoo.fr> <432C6ABE.9060706@wanadoo.fr> <20050917200732.GA34770@troutmask.apl.washington.edu> <432CDBD6.9080307@wanadoo.fr>
PRs 19181 and 21300 have fixed themselves. The enclosed test exercises
the original bug.
Regtested on FC3/Athlon1700.
OK for mainline and 4.03, when open?
Paul T
2005-09-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/19181
* gfortran.dg/derived_pointer_null_1.f90: New test.
! { dg-do compile }
!
! Test of fix (patch unknown) for pr19181 and pr21300. This test is based
! on the example given in 21300. Note that this can be executed.
!
! Contributed by Paul Thomas <paultcc.gnu.org>
!
TYPE ast_obs
real, DIMENSION(:), POINTER :: geopos
END TYPE ast_obs
TYPE(ast_obs), PARAMETER :: undefined_ast_obs = AST_OBS(NULL())
type(ast_obs) :: my_ast_obs
real, target, dimension(10) :: rt
my_ast_obs%geopos => rt
if (.not.associated (my_ast_obs%geopos)) call abort ()
call get_null_ast_obs (my_ast_obs)
if (associated (my_ast_obs%geopos)) call abort ()
CONTAINS
SUBROUTINE get_null_ast_obs (obs1)
TYPE(ast_obs) :: obs1
obs1 = undefined_ast_obs
RETURN
END SUBROUTINE get_null_ast_obs
END