summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/specs/empty_variants.ads
blob: 079b64ac812203f9b8012790ce0bdb625fe22b1f (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
25
26
27
28
29
30
31
32
--  { dg-do compile }
--  { dg-options "-gnatdF" }

package Empty_Variants is
   
   type Rec (D : Integer := 1) is record
      case D is
         when 1 =>
            I : Integer;
         when 2 .. 5 =>
            J : Integer;
            K : Integer;
         when 6 =>
            null;
         when 7 .. 8 =>
            null;
         when others =>
            L : Integer;
            M : Integer;
            N : Integer;
      end case;
   end record;
   
   R : Rec;
   
   I : Integer := R.I;
   J : Integer := R.J;
   K : Integer := R.K;
   L : Integer := R.L;
   M : Integer := R.L;

end Empty_Variants;