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/] [pack4.adb] - Rev 304

Compare with Previous | Blame | View Log

-- { dg-do run }
 
procedure Pack4 is
 
   type Time_T is record
      Hour : Integer;
   end record;
 
   type Date_And_Time_T is record
      Date : Integer;
      Time : Time_T;
   end record;
 
   pragma Pack(Date_And_Time_T);
 
   procedure
     Assign_Hour_Of (T : out Time_T)
   is
   begin
      T.Hour := 44;
   end;
 
   procedure
     Clobber_Hour_Of (DT: out Date_And_Time_T)
   is
   begin
      Assign_Hour_Of (Dt.Time);
   end;
 
   DT : Date_And_Time_T;
 
begin
   DT.Time.Hour := 22;
   Clobber_Hour_Of (DT);
   if DT.Time.Hour /= 44 then
     raise Program_Error;
   end if;
end;
 

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.