diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2005-09-18 15:58:58 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2005-09-18 15:58:58 +0000 |
commit | 30bf3b40e6ecbfcdd67518a7cf8b8bf9b2fb18c1 (patch) | |
tree | d41bc1260679646e458b98a3171a249307cb6cfb | |
parent | c2953725717c182dbc606bf9454af29e30918ccf (diff) | |
download | gcc-30bf3b40e6ecbfcdd67518a7cf8b8bf9b2fb18c1.zip gcc-30bf3b40e6ecbfcdd67518a7cf8b8bf9b2fb18c1.tar.gz gcc-30bf3b40e6ecbfcdd67518a7cf8b8bf9b2fb18c1.tar.bz2 |
re PR fortran/19181 (ICE and segmentation fault with pointer member in user defined type)
2005-09-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/19181
* gfortran.dg/derived_pointer_null_1.f90: New test.
From-SVN: r104403
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/derived_pointer_null_1.f90 | 32 |
2 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b02eaa6..ee977a6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-09-18 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/19181 + * gfortran.dg/derived_pointer_null_1.f90: New test. + 2005-09-18 Richard Guenther <rguenther@suse.de> PR middle-end/23944 diff --git a/gcc/testsuite/gfortran.dg/derived_pointer_null_1.f90 b/gcc/testsuite/gfortran.dg/derived_pointer_null_1.f90 new file mode 100644 index 0000000..3e7673f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/derived_pointer_null_1.f90 @@ -0,0 +1,32 @@ +! { dg-do compile } +! { dg-options "-std=gnu" } +! +! 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 <pault@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 + |