OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gnat.dg/] [derived_aggregate.adb] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 304 jeremybenn
-- { dg-do run }
2
-- { dg-options "-O2" }
3
 
4
procedure Derived_Aggregate is
5
  type Int is range 1 .. 10;
6
  type Str is array (Int range <>) of Character;
7
 
8
  type Parent (D1, D2 : Int; B : Boolean) is
9
    record
10
      S : Str (D1 .. D2);
11
      case B is
12
        when False => C1 : Integer;
13
        when True =>  C2 : Float;
14
      end case;
15
    end record;
16
 
17
  for Parent'Alignment use 8;
18
 
19
  type Derived (D : Int) is new Parent (D1 => D, D2 => D, B => False);
20
 
21
  function Ident (I : Integer) return integer is
22
  begin
23
     return I;
24
  end;
25
 
26
  Y : Derived := (D => 7, S => "b", C1 => Ident (32));
27
 
28
begin
29
  if Parent(Y).D1 /= 7 then
30
    raise Program_Error;
31
  end if;
32
end;

powered by: WebSVN 2.1.0

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