gcc/cp
[official-gcc.git] / gcc / testsuite / gnat.dg / derived_type1.adb
blobc50d5ef466a423f46a284e8550b71cb14ddd3de8
1 -- { dg-do compile }
2 -- { dg-options "-gnatws -fdump-tree-original" }
4 procedure Derived_Type1 is
6 type Root is tagged null record;
8 type Derived1 is new Root with record
9 I1 : Integer;
10 end record;
12 type Derived2 is new Derived1 with record
13 I2: Integer;
14 end record;
16 R : Root;
17 D1 : Derived1;
18 D2 : Derived2;
20 begin
21 R := Root(D1);
22 R := Root(D2);
23 D1 := Derived1(D2);
24 end;
26 -- { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR<struct derived_type1__root>" "original" } }
27 -- { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR<struct derived_type1__derived1>" "original" } }
28 -- { dg-final { cleanup-tree-dump "original" } }