1-- { dg-do compile }
2-- { dg-options "-O2 -gnatws" }
3
4procedure Opt16 is
5
6   generic
7      type T (<>) is private;
8      V, V1 : T;
9      with function F1 (X : T) return T;
10   package GP is
11      R : Boolean := F1 (V) = V1;
12   end GP;
13
14   type AB is array (Boolean range <>) of Boolean;
15
16begin
17   for I1 in Boolean loop
18      for I2 in Boolean loop
19         declare
20            B1 : Boolean := I1;
21            B2 : Boolean := I2;
22            AB1 : AB (Boolean) := (I1, I2);
23            T : AB (B1 .. B2) := (B1 .. B2 => True);
24            F : AB (B1 .. B2) := (B1 .. B2 => False);
25
26            package P is new GP (AB, AB1, NOT AB1, "NOT");
27
28         begin
29            null;
30         end;
31      end loop;
32   end loop;
33end;
34