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/] [bit_packed_array3.adb] - Blame information for rev 308

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

Line No. Rev Author Line
1 304 jeremybenn
-- { dg-do run }
2
-- { dg-options "-O2 -gnatp" }
3
 
4
procedure Bit_Packed_Array3 is
5
 
6
   type Bitmap_T is array (1 .. 10) of Boolean;
7
   pragma Pack (Bitmap_T);
8
 
9
   type Maps_T is record
10
      M1 : Bitmap_T;
11
   end record;
12
   pragma Pack (Maps_T);
13
   for Maps_T'Size use 10;
14
   pragma Suppress_Initialization (Maps_T);
15
 
16
   Tmap : constant Bitmap_T := (others => True);
17
   Fmap : constant Bitmap_T := (others => False);
18
   Amap : constant Bitmap_T :=
19
     (1 => False, 2 => True, 3 => False, 4 => True, 5 => False,
20
      6 => True, 7 => False, 8 => True, 9 => False, 10 => True);
21
 
22
   function Some_Maps return Maps_T is
23
      Value : Maps_T := (M1 => Amap);
24
   begin
25
      return Value;
26
   end;
27
   pragma Inline (Some_Maps);
28
 
29
   Maps : Maps_T;
30
begin
31
   Maps := Some_Maps;
32
 
33
   for I in Maps.M1'Range loop
34
      if (I mod 2 = 0 and then not Maps.M1 (I))
35
        or else (I mod 2 /= 0 and then Maps.M1 (I))
36
      then
37
         raise Program_Error;
38
      end if;
39
   end loop;
40
end;

powered by: WebSVN 2.1.0

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