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] - Blame information for rev 304

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 304 jeremybenn
-- { dg-do run }
2
 
3
procedure Pack4 is
4
 
5
   type Time_T is record
6
      Hour : Integer;
7
   end record;
8
 
9
   type Date_And_Time_T is record
10
      Date : Integer;
11
      Time : Time_T;
12
   end record;
13
 
14
   pragma Pack(Date_And_Time_T);
15
 
16
   procedure
17
     Assign_Hour_Of (T : out Time_T)
18
   is
19
   begin
20
      T.Hour := 44;
21
   end;
22
 
23
   procedure
24
     Clobber_Hour_Of (DT: out Date_And_Time_T)
25
   is
26
   begin
27
      Assign_Hour_Of (Dt.Time);
28
   end;
29
 
30
   DT : Date_And_Time_T;
31
 
32
begin
33
   DT.Time.Hour := 22;
34
   Clobber_Hour_Of (DT);
35
   if DT.Time.Hour /= 44 then
36
     raise Program_Error;
37
   end if;
38
end;

powered by: WebSVN 2.1.0

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