2010-04-20 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gnat.dg / lhs_view_convert.adb
blobe7947f033d889730e4a53b6053d2b2f60fef6641
1 -- { dg-do run }
2 -- { dg-options "-gnatp" }
4 procedure Lhs_View_Convert is
6 type Root is tagged record
7 RV : Natural;
8 end record;
10 type Derived is new Root with null record;
12 Root_Instance : Root := (RV => 1);
14 Derived_Instance : Derived;
16 procedure Process is
17 X : Natural := Derived_Instance.RV;
18 begin
19 null;
20 end;
21 begin
22 Derived_Instance.RV := 2;
24 Root (Derived_Instance) := Root (Root_Instance);
26 if Derived_Instance.RV /= Root_Instance.RV then
27 raise Program_Error;
28 end if;
29 end;