Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / pdt_35.f03
blob8b99948fa735e9051811258c130608f254d9e2e8
1 ! { dg-do compile }
3 ! Tests the fixes for PR82943.
5 ! This test focuses on inheritance for the type bound procedures.
7 ! Contributed by Alexander Westbrooks  <ctechnodev@gmail.com>
9 module m
11    public :: foo, bar, foobar
13    type, public :: goodpdt_lvl_0(a, b)
14        integer, kind :: a = 1
15        integer, len :: b
16    contains
17        procedure :: foo
18    end type
20    type, public, EXTENDS(goodpdt_lvl_0) :: goodpdt_lvl_1 (c)
21        integer, len :: c
22    contains
23        procedure :: bar
24    end type
26    type, public, EXTENDS(goodpdt_lvl_1) :: goodpdt_lvl_2 (d)
27        integer, len :: d
28    contains
29        procedure :: foobar
30    end type
32 contains
33    subroutine foo(this)
34        class(goodpdt_lvl_0(1,*)), intent(inout) :: this
35    end subroutine
37    subroutine bar(this)
38        class(goodpdt_lvl_1(1,*,*)), intent(inout) :: this
39    end subroutine
41    subroutine foobar(this)
42        class(goodpdt_lvl_2(1,*,*,*)), intent(inout) :: this
43    end subroutine
45 end module