OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gnat.dg/] [alignment2.adb] - Rev 304

Compare with Previous | Blame | View Log

-- { dg-do run }
 
procedure alignment2 is
 
   pragma COMPONENT_ALIGNMENT(STORAGE_UNIT);
 
   MAX_LIST_SIZE : constant INTEGER := 128*16;
 
   LEVEL2_SIZE : constant INTEGER := 128;
 
           LEVEL1_SIZE : constant INTEGER
              := (MAX_LIST_SIZE - 1) / LEVEL2_SIZE + 1;
 
           type LEVEL2_ARRAY_TYPE is
              array (1..LEVEL2_SIZE) of Integer;
 
           type LEVEL2_TYPE is
              record
                 NUM  : INTEGER := 0;
                 DATA : LEVEL2_ARRAY_TYPE := ( others => 0 );
              end record;
 
           type LEVEL2_PTR_TYPE is access all LEVEL2_TYPE;
 
           type LEVEL1_ARRAY_TYPE is
              array( 1..LEVEL1_SIZE ) of LEVEL2_PTR_TYPE;
 
           type LEVEL1_TYPE is
              record
                 LAST_LINE  : INTEGER := 0;
                 LEVEL2_PTR : LEVEL1_ARRAY_TYPE;
              end record;
 
           L1 : LEVEL1_TYPE;
           L2 : aliased LEVEL2_TYPE;
 
   procedure q (LA : in out LEVEL1_ARRAY_TYPE) is
   begin
      LA (1) := L2'Access;
   end;
 
begin
   q (L1.LEVEL2_PTR);
   if L1.LEVEL2_PTR (1) /= L2'Access 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.