RISC-V: Regenerate opt urls.
[official-gcc.git] / gcc / testsuite / gfortran.dg / derived_pointer_null_1.f90
blobdef6998b8a1ecaff4401afb646ec9419987a6e78
1 ! { dg-do compile }
2 ! { dg-options "-std=gnu" }
4 ! Test of fix (patch unknown) for pr19181 and pr21300. This test is based
5 ! on the example given in 21300. Note that this can be executed.
7 ! Contributed by Paul Thomas <pault@gnu.org>
9 TYPE ast_obs
10 real, DIMENSION(:), POINTER :: geopos
11 END TYPE ast_obs
13 TYPE(ast_obs), PARAMETER :: undefined_ast_obs = AST_OBS(NULL())
14 type(ast_obs) :: my_ast_obs
15 real, target, dimension(10) :: rt
17 my_ast_obs%geopos => rt
18 if (.not.associated (my_ast_obs%geopos)) STOP 1
20 call get_null_ast_obs (my_ast_obs)
21 if (associated (my_ast_obs%geopos)) STOP 2
23 CONTAINS
25 SUBROUTINE get_null_ast_obs (obs1)
26 TYPE(ast_obs) :: obs1
27 obs1 = undefined_ast_obs
28 RETURN
29 END SUBROUTINE get_null_ast_obs
31 END