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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gnat.dg/] [discr33.adb] - Blame information for rev 749

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

Line No. Rev Author Line
1 696 jeremybenn
-- { dg-do run }
2
 
3
procedure Discr33 is
4
 
5
   subtype Int is Integer range 1..100;
6
 
7
   type T (D : Int := 1) is
8
      record
9
         A : Integer;
10
         B : String (1..D);
11
         C : aliased Integer;
12
      end record;
13
 
14
   Var : T := (D => 1, A => 1234, B => "x", C => 4567);
15
 
16
   type Int_Ref is access all Integer;
17
   Pointer_To_C : Int_Ref := Var.C'Access;
18
 
19
begin
20
 
21
   if Pointer_To_C.all /= 4567 then
22
      raise Program_Error;
23
   end if;
24
 
25
   Var := (D => 26, A => 1234, B => "abcdefghijklmnopqrstuvwxyz", C => 2345);
26
 
27
   if Pointer_To_C.all /= 2345 then
28
      raise Program_Error;
29
   end if;
30
 
31
end Discr33;

powered by: WebSVN 2.1.0

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