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] - Rev 316

Go to most recent revision | Compare with Previous | Blame | View Log

-- { dg-do run }
 
with Ada.Real_Time.Timing_Events;
use Ada.Real_Time, Ada.Real_Time.Timing_Events;
 
procedure Timer_Cancel is
 
   E : Timing_Event;
   C : Boolean;
 
   protected Dummy is
      procedure Trigger (Event : in out Timing_Event);
   end Dummy;
 
   protected body Dummy is
      procedure Trigger (Event : in out Timing_Event) is
      begin
         null;
      end Trigger;
   end Dummy;
 
begin
   Set_Handler (E, Time_Last, Dummy.Trigger'Unrestricted_Access);
 
   if Time_Of_Event (E) /= Time_Last then
      raise Program_Error with "Event time not set correctly";
   end if;
 
   Cancel_Handler (E, C);
 
   if not C then
      raise Program_Error with "Event triggered already";
   end if;
 
   if Time_Of_Event (E) /= Time_First then
      raise Program_Error with "Event time not reset correctly";
   end if;
end Timer_Cancel;
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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