Debian Codegraph @

gcc/testsuite/gfortran.dg/class_29.f03

raw
1 ! { dg-do compile }
2 !
3 ! PR 46313: [OOP] OOP-ABI issue, ALLOCATE issue, CLASS renaming issue
4 !
5 ! Contributed by Tobias Burnus <[email protected]>
6
7 module m1
8 type mytype
9 real :: a(10) = 2
10 end type
11 end module m1
12
13 module m2
14 type mytype
15 real :: b(10) = 8
16 end type
17 end module m2
18
19 program p
20 use m1, t1 => mytype
21 use m2, t2 => mytype
22 implicit none
23
24 class(t1), allocatable :: x
25 class(t2), allocatable :: y
26
27 allocate (t1 :: x)
28 allocate (t2 :: y)
29
30 print *, x%a
31 print *, y%b
32 end