1-- { dg-do run }
2
3procedure Slice4 is
4
5   type Varray is array (1 .. 1) of Natural;  -- SImode
6
7   type Rec is record
8      Values : Varray;
9   end record;
10
11   type Sample is record
12      Maybe  : Boolean;
13      R : Rec;
14   end record;
15   pragma Pack (Sample);
16
17   function Match (X, Y: Sample; Length : Positive) return Boolean is
18   begin
19      return X.R.Values (1 .. Length) = Y.R.Values (1 .. Length);
20   end;
21
22   X, Y : Sample := (Maybe => True, R => (Values => (1 => 1)));
23begin
24   X.Maybe := False;
25   if not Match (X, Y, 1) then
26      raise Program_Error;
27   end if;
28end;
29