aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gnat.dg/self_aggregate_with_array.adb
blob: 850e5defffc54da34c59a9056b9a97c56698063c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- { dg-do run }

procedure self_aggregate_with_array is

   type Value_Bounds is array (1 .. 2) of Natural;

   type Sensor is record
      Value  : Natural;
      Bounds : Value_Bounds;
   end record;

   Pressure : Sensor;

begin
   Pressure.Value := 256;
   Pressure := (Value => Pressure.Value, Bounds => (1, 2));

   if Pressure.Value /= 256 then
      raise Program_Error;
   end if;
end;