aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8.3/gcc/testsuite/gnat.dg/discr38.adb
blob: 948493f74be62b91a024eec4e3f41e4903925843 (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
33
34
35
36
37
38
39
40
-- { dg-do compile }

procedure Discr38 is

   type Enum is (OK,
                 NOT_CONNECTED,
                 DISCONNECTED,
                 REQUEST_Q_EMPTY,
                 SERVER_UNAVAILABLE,
                 BUFFER_TOO_SMALL,
                 NO_FREE_SLOT,
                 RAISE_EXCEPTION,
                 REQUEST_CANCELLED,
                 REQUEST_IN_PROGRESS,
                 SERVER_BUSY,
                 BLOCK_ACKNOWLEDGE);

   type R (Status : Enum := OK) is record
      Status_Block : Integer;
      case Status is
      when RAISE_EXCEPTION =>
         I : Integer;
      when OK =>
         Length : Natural;
         Data   : Integer;
      when others =>
         null;
      end case;
   end record;
   for R use record
      Status        at  0 range 0 .. 7;
      Status_Block  at  4 range 0 .. 31;
      Length        at  8 range 0 .. 31;
   end record;

   Nil : constant R := (OK, 1, 0, 1);

begin
   null;
end;