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/] [oconst4.ads] - Blame information for rev 304

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 304 jeremybenn
package OCONST4 is
2
 
3
  type bit is (zero, one);
4
  type u2 is mod 2**2;
5
  type u5 is mod 2**5;
6
  type u8 is mod 2**8;
7
 
8
  type Base is record
9
    f1 : bit;
10
    f2 : u2;
11
    f3 : u5;
12
    f4 : u8;
13
  end record;
14
 
15
  for Base use record
16
    f1 at 0 range  0 .. 0;
17
    f2 at 0 range  1 .. 2;
18
    f3 at 0 range  3 .. 7;
19
    f4 at 1 range  0 .. 7;
20
  end record;
21
 
22
  type Derived is record
23
    f1 : u5;
24
    b  : Base;
25
    f2 : bit;
26
    f3 : u2;
27
    f4 : u8;
28
    i1 : Integer;
29
    i2 : Integer;
30
  end record;
31
 
32
  for Derived use record
33
    f1 at 0 range  0 ..  4;
34
    b  at 0 range  5 .. 20;  -- unaligned HImode bitfield
35
    f2 at 0 range 21 .. 21;
36
    f3 at 0 range 22 .. 23;
37
    f4 at 0 range 24 .. 31;
38
    i1 at 4 range  0 .. 31;
39
    i2 at 8 range  0 .. 31;
40
  end record;
41
 
42
  type R is record
43
    u : u8;
44
    d : Derived;
45
  end record;
46
 
47
  for R use record
48
    u at 0 range 0 .. 7;
49
    d at 1 range 0 .. 95;  -- BLKmode bitfield
50
  end record;
51
 
52
  My_R : constant R := (u=>1,
53
                        d=>(f1=>17,
54
                            b=>(f1=>one,
55
                                f2=>2,
56
                                f3=>17,
57
                                f4=>42),
58
                            f2=>one,
59
                            f3=>1,
60
                            f4=>111,
61
                            i1=>2,
62
                            i2=>3));
63
 
64
  procedure check (arg : R);
65
 
66
end;

powered by: WebSVN 2.1.0

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