nvptx, libgfortran: Switch out of "minimal" mode
[official-gcc.git] / gcc / testsuite / gfortran.dg / pdt_36.f03
bloba351c0e4f8b37496e7bea041e70f5cc2b95b2f0b
1 ! { dg-do run }
3 ! Tests the fixes for PR82943.
5 ! This test focuses on calling the type bound procedures in a program.
7 ! Contributed by Alexander Westbrooks  <ctechnodev@gmail.com>
9 module testmod
11    public :: foo
13    type, public :: tough_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(tough_lvl_0) :: tough_lvl_1 (c)
21        integer, len :: c
22    contains
23        procedure :: bar
24    end type
26    type, public, EXTENDS(tough_lvl_1) :: tough_lvl_2 (d)
27        integer, len :: d
28    contains
29        procedure :: foobar
30    end type
32 contains
33    subroutine foo(this)
34        class(tough_lvl_0(1,*)), intent(inout) :: this
35    end subroutine
37    subroutine bar(this)
38        class(tough_lvl_1(1,*,*)), intent(inout) :: this
39    end subroutine
41    subroutine foobar(this)
42        class(tough_lvl_2(1,*,*,*)), intent(inout) :: this
43    end subroutine
45 end module
47 PROGRAM testprogram
48    USE testmod
49    
50    TYPE(tough_lvl_0(1,5))     :: test_pdt_0
51    TYPE(tough_lvl_1(1,5,6))   :: test_pdt_1
52    TYPE(tough_lvl_2(1,5,6,7)) :: test_pdt_2
54    CALL test_pdt_0%foo()
56    CALL test_pdt_1%foo()
57    CALL test_pdt_1%bar()
59    CALL test_pdt_2%foo()
60    CALL test_pdt_2%bar()
61    CALL test_pdt_2%foobar()
64 END PROGRAM testprogram