diff options
Diffstat (limited to 'gcc/testsuite/gnat.dg/self_aggregate_with_array.adb')
-rw-r--r-- | gcc/testsuite/gnat.dg/self_aggregate_with_array.adb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/self_aggregate_with_array.adb b/gcc/testsuite/gnat.dg/self_aggregate_with_array.adb new file mode 100644 index 000000000..850e5deff --- /dev/null +++ b/gcc/testsuite/gnat.dg/self_aggregate_with_array.adb @@ -0,0 +1,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; |