summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/timing_events.adb
blob: 589c14209aeac1d0c61ec54c25a011c5aa3ec308 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- { dg-do run }

procedure Timing_Events is
   type Timing_Event_Handler is access protected procedure;
   
   protected PO is
      entry     Test;
      procedure Proc;
   private
      Data : Integer := 99;
   end PO;
   
   protected body PO is
      entry Test when True is
         Handler : Timing_Event_Handler := Proc'Access;
      begin
         Handler.all;
      end Test;
      
      procedure Proc is
      begin
         if Data /= 99 then
            raise Program_Error;
         end if;
      end Proc;
   end PO;
begin
   PO.Test;
end;