Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gnat.dg / generic_call_iface.adb
blob0e173ea73c83613cf596c6dc8a8b23423a82a278
1 -- { dg-do compile }
3 procedure Generic_Call_Iface is
5 generic
6 type Subscriber_Type is interface;
7 with procedure On_Changed (Subscriber : in out Subscriber_Type)
8 is abstract;
9 package My_Generic is
10 type Subscriber_Ptr is access all Subscriber_Type'Class;
11 procedure Update;
12 Subscriber : Subscriber_Ptr := null;
13 end;
15 package body My_Generic is
16 procedure Update is
17 begin
18 if Subscriber /= null then
19 Subscriber.On_Changed;
20 end if;
21 end;
22 end;
24 package User is
25 type Integer_Subscriber is interface;
26 procedure On_Changed_Int (I : in out Integer_Subscriber) is abstract;
28 package P is new My_Generic
29 (Subscriber_Type => Integer_Subscriber,
30 On_Changed => On_Changed_Int);
31 end;
32 begin
33 null;
34 end;