OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gnat.dg/] [timer_cancel.adb] - Blame information for rev 304

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 304 jeremybenn
-- { dg-do run }
2
 
3
with Ada.Real_Time.Timing_Events;
4
use Ada.Real_Time, Ada.Real_Time.Timing_Events;
5
 
6
procedure Timer_Cancel is
7
 
8
   E : Timing_Event;
9
   C : Boolean;
10
 
11
   protected Dummy is
12
      procedure Trigger (Event : in out Timing_Event);
13
   end Dummy;
14
 
15
   protected body Dummy is
16
      procedure Trigger (Event : in out Timing_Event) is
17
      begin
18
         null;
19
      end Trigger;
20
   end Dummy;
21
 
22
begin
23
   Set_Handler (E, Time_Last, Dummy.Trigger'Unrestricted_Access);
24
 
25
   if Time_Of_Event (E) /= Time_Last then
26
      raise Program_Error with "Event time not set correctly";
27
   end if;
28
 
29
   Cancel_Handler (E, C);
30
 
31
   if not C then
32
      raise Program_Error with "Event triggered already";
33
   end if;
34
 
35
   if Time_Of_Event (E) /= Time_First then
36
      raise Program_Error with "Event time not reset correctly";
37
   end if;
38
end Timer_Cancel;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.