aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gnat.dg/controlled6.adb
blob: 88640de7beaadac1e722f1778f893884e2b102a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- { dg-do compile }
-- { dg-options "-O -gnatn" }

with Ada.Text_IO; use Ada.Text_IO;
with Controlled6_Pkg;
with Controlled6_Pkg.Iterators;

procedure Controlled6 is

   type String_Access is access String;

   package My_Q is new Controlled6_Pkg (String_Access);
   package My_Iterators is new My_Q.Iterators (0);
   use My_Iterators;

   Iterator : Iterator_Type := Find;

begin
   loop
      exit when Is_Null (Iterator);
      Put (Current (Iterator).all & ' ');
      Find_Next (Iterator);
   end loop;
end;