File: derived_pointer_null_1.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (32 lines) | stat: -rw-r--r-- 781 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)) STOP 1

  call get_null_ast_obs (my_ast_obs)
  if (associated (my_ast_obs%geopos)) STOP 2

CONTAINS

  SUBROUTINE get_null_ast_obs (obs1)
    TYPE(ast_obs)  :: obs1
    obs1 = undefined_ast_obs
    RETURN
  END SUBROUTINE get_null_ast_obs

END