PR debug/66535
[official-gcc.git] / gcc / testsuite / gnat.dg / opt27.adb
blobbe1980076a4fb78c1bb63c8875fc9f165f90ed30
1 -- { dg-do run }
2 -- { dg-options "-O" }
4 with Opt27_Pkg;
6 procedure Opt27 is
8 type Rec_T is record
9 A, B, C, D, E : Integer;
10 end record;
12 package List is new Opt27_Pkg (Rec_T);
14 My_List : List.List_T;
16 function Is_Match (Element : Rec_T; Template : Integer) return Boolean is
17 begin
18 return (Element.C = Template);
19 end;
21 function Find_Int is new List.Find_Elem (Integer, Is_Match);
23 Node : List.Node_T := Find_Int (10, My_List);
25 begin
26 if not List.Is_Null (Node) then
27 raise Program_Error;
28 end if;
29 end;