summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/array5.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gnat.dg/array5.adb')
-rw-r--r--gcc/testsuite/gnat.dg/array5.adb34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/array5.adb b/gcc/testsuite/gnat.dg/array5.adb
new file mode 100644
index 00000000000..72a5df821e6
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array5.adb
@@ -0,0 +1,34 @@
+-- { dg-do run }
+-- { dg-options "-O" }
+
+procedure Array5 is
+
+ type myint is range 0 .. 100_000;
+ Bla : constant myint := 359;
+
+ type my_array is array (1 .. 2) of myint;
+
+ type item is record
+ Length : Integer;
+ Content : my_array;
+ end record;
+
+ procedure create_item (M : out item) is
+ begin
+ M.Length := 1;
+ M.Content := (others => Bla);
+ end;
+
+ Var : item;
+
+begin
+ create_item (Var);
+
+ if Var.Length = 1
+ and then Var.Content (1) = Bla
+ then
+ null;
+ else
+ raise Program_Error;
+ end if;
+end;