summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/discr22.adb
blob: af4f9ab78997d006263ec3b7eeb34151126a46d2 (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 compile }
-- { dg-options "-gnatws" }

procedure Discr22 is

   subtype Precision is Integer range 1 .. 5;

   type Rec(D1 : Precision; D2 : Integer) is record
      case D1 is
         when 1 => I : Integer;
         when others => null;
      end case;
   end record;
   for Rec use record
      D1 at 0 range 0 .. 7;
   end record;

   P : Precision;
   X : Rec(P, 0);

begin
   null;
end;