1 ! { dg-require-profiling "-fprofile-generate" }
2 ! { dg-options "-Ofast" }
4 ! PR 45076: [OOP] gfortran.dg/dynamic_dispatch_6.f03 ICEs with -fprofile-use
6 ! Contributed by Damian Rouson <damian@rouson.net>
12 type ,abstract :: field
16 module periodic_5th_order_module
17 use field_module ,only : field
19 type ,extends(field) :: periodic_5th_order
23 module field_factory_module
26 public :: field_factory
27 type, abstract :: field_factory
29 procedure(create_interface), deferred :: create
32 function create_interface(this)
33 use field_module ,only : field
34 import :: field_factory
35 class(field_factory), intent(in) :: this
36 class(field) ,pointer :: create_interface
41 module periodic_5th_factory_module
42 use field_factory_module , only : field_factory
45 public :: periodic_5th_factory
46 type, extends(field_factory) :: periodic_5th_factory
48 procedure :: create=>new_periodic_5th_order
51 function new_periodic_5th_order(this)
52 use field_module ,only : field
53 use periodic_5th_order_module ,only : periodic_5th_order
54 class(periodic_5th_factory), intent(in) :: this
55 class(field) ,pointer :: new_periodic_5th_order
60 use field_module ,only : field
61 use field_factory_module ,only : field_factory
62 use periodic_5th_factory_module ,only : periodic_5th_factory
64 class(field) ,pointer :: u
65 class(field_factory), allocatable :: field_creator
66 allocate (periodic_5th_factory :: field_creator)
67 u => field_creator%create()