2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gnat.dg / controlled6.adb
blob88640de7beaadac1e722f1778f893884e2b102a2
1 -- { dg-do compile }
2 -- { dg-options "-O -gnatn" }
4 with Ada.Text_IO; use Ada.Text_IO;
5 with Controlled6_Pkg;
6 with Controlled6_Pkg.Iterators;
8 procedure Controlled6 is
10 type String_Access is access String;
12 package My_Q is new Controlled6_Pkg (String_Access);
13 package My_Iterators is new My_Q.Iterators (0);
14 use My_Iterators;
16 Iterator : Iterator_Type := Find;
18 begin
19 loop
20 exit when Is_Null (Iterator);
21 Put (Current (Iterator).all & ' ');
22 Find_Next (Iterator);
23 end loop;
24 end;