Debian Codegraph @

gcc/testsuite/gfortran.dg/class_65.f90

raw
1 ! { dg-do run }
2 !
3 ! Test the fix for PR81447 in which a vtable was not being created
4 ! in the module 'm' so that x->vptr in 's' did not have the same
5 ! value as that in 'p'.
6 !
7 ! Contributed by Mat Cross <[email protected]>
8 !
9 Module m
10 Type :: t
11 integer :: i
12 End Type
13 End Module
14
15 Program p
16 Use m
17 Class (t), Allocatable :: x
18 Interface
19 Subroutine s(x)
20 Use m
21 Class (t), Allocatable :: x
22 End Subroutine
23 End Interface
24 Call s(x)
25 Select Type (x)
26 Type Is (t)
27 Continue
28 Class Is (t)
29 STOP 1
30 Class Default
31 STOP 2
32 End Select
33 ! Print *, 'ok'
34 End Program
35
36 Subroutine s(x)
37 Use m, Only: t
38 Implicit None
39 Class (t), Allocatable :: x
40 Allocate (t :: x)
41 End Subroutine