aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gnat.dg/enum3.adb
blob: 1cb6c4b564861094e2bb5ffc280290f74768b912 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- { dg-do run }

procedure Enum3 is
   type Enum is (Aaa, Bbb, Ccc);
   for Enum use (1,2,4);
begin
   for Lo in Enum loop
      for Hi in Enum loop
         declare
            subtype S is Enum range Lo .. Hi;
            type Vector is array (S) of Integer;
            Vec : Vector;
         begin
            for I in S loop
               Vec (I) := 0;
            end loop;
            if Vec /= (S => 0) then
               raise Program_Error;
            end if;
         end;
      end loop;
   end loop;
end;