summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/class_40.f03
blob: bd367dfe5b54ba6646e90317bfac228da1cf12ec (plain)
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
33
34
35
36
! { dg-do run }
!
! PR 47767: [OOP] SELECT TYPE fails to execute correct TYPE IS block
!
! Contributed by Andrew Benson <abenson@caltech.edu>

module Tree_Nodes
  type treeNode
   contains
     procedure :: walk
  end type
contains
  subroutine walk (thisNode)
    class (treeNode) :: thisNode
    print *, SAME_TYPE_AS (thisNode, treeNode())
  end subroutine
end module

module Merger_Trees
  use Tree_Nodes
  private
  type(treeNode), public :: baseNode
end module

module Merger_Tree_Build
  use Merger_Trees
end module

program test
  use Merger_Tree_Build
  use Tree_Nodes
  type(treeNode) :: node
  call walk (node)
end program

! { dg-final { cleanup-modules "Tree_Nodes Merger_Trees Merger_Tree_Build" } }