PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gnat.dg / discr21.adb
blob5c105cdb25c17fa2abb3fbf60d6d7e7fde2bfc90
1 -- { dg-do compile }
2 -- { dg-options "-gnatws -O3" }
4 with Discr21_Pkg; use Discr21_Pkg;
6 package body Discr21 is
8 type Index is new Natural range 0 .. 100;
10 type Arr is array (Index range <> ) of Position;
12 type Rec(Size : Index := 1) is record
13 A : Arr(1 .. Size);
14 end record;
16 Data : Rec;
18 function To_V(pos : Position) return VPosition is
19 begin
20 return To_Position(pos.x, pos.y, pos.z);
21 end;
23 procedure Read(Data : Rec) is
24 pos : VPosition := To_V (Data.A(1));
25 begin
26 null;
27 end;
29 procedure Test is
30 begin
31 Read (Data);
32 end;
34 end Discr21;