1-- { dg-do compile }
2
3with System;
4
5package Discr5 is
6
7   X, Y : Boolean;
8
9   type R (D : Boolean := False) is tagged limited record
10      F : Integer;
11      case D is
12         when True =>
13            F1, F2 : Integer;
14         when False =>
15            null;
16      end case;
17   end record;
18   for R use record
19      F1 at 100 range 0..31;
20   end record;
21
22   subtype Rt is R(True);
23   subtype Rf is R(False);
24
25   type R1 (D1 : Boolean) is new R (X) with record
26      FF : Float;
27      case D1 is
28         when True =>
29            F3, F4 : Float;
30         when False =>
31            null;
32      end case;
33   end record;
34   for R1 use record
35      F4 at 200 range 0..31;
36   end record;
37
38   subtype R1t is R1 (True);
39   subtype R1f is R1 (False);
40
41   type R2 (D2 : Boolean) is new R1 (Y) with record
42      FFF: System.Address;
43      case D2 is
44         when True =>
45            F5, F6: System.Address;
46         when False =>
47            null;
48      end case;
49   end record;
50   for R2 use record
51      F6 at 300 range 0..63;
52   end record;
53
54   subtype R2t is R2 (True);
55   subtype R2f is R2 (False);
56
57end Discr5;
58