3 ! PR 41829: [OOP] Runtime error with dynamic dispatching. Tests
4 ! dynamic dispatch in a case where the caller knows nothing about
5 ! the dynamic type at compile time.
7 ! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
13 procedure, pass(a) :: doit
14 procedure, pass(a) :: getit
23 ! write(*,*) 'FOO%DOIT base version'
25 function getit(a) result(res)
36 type, extends(foo) :: foo2
39 procedure, pass(a) :: doit => doit2
40 procedure, pass(a) :: getit => getit2
52 ! write(*,*) 'FOO2%DOIT derived version'
54 function getit2(a) result(res)
66 class(foo), allocatable :: a
68 procedure, pass(a) :: doit
69 procedure, pass(a) :: getit
79 function getit(a) result(res)
97 ! write(*,*) 'Getit value : ', a%getit()
98 if (a%getit() .ne. 1) call abort
100 allocate(foo2 :: a%a)
102 ! write(*,*) 'Getit value : ', a%getit()
103 if (a%getit() .ne. 3) call abort
107 ! { dg-final { cleanup-modules "foo_mod foo2_mod bar_mod" } }