summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/opt19.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-24 07:38:19 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-24 07:38:19 +0000
commitb7459437aef76ee975ddd0e969077c7c1c77aa13 (patch)
tree3d61b51956e0e99640086b8707875344e2e74bbc /gcc/testsuite/gnat.dg/opt19.adb
parentaca21847a28e296d86dae8f53863487378926c6d (diff)
downloadgcc-b7459437aef76ee975ddd0e969077c7c1c77aa13.tar.gz
2011-09-24 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 179138 using svnmerge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@179139 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gnat.dg/opt19.adb')
-rw-r--r--gcc/testsuite/gnat.dg/opt19.adb27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/opt19.adb b/gcc/testsuite/gnat.dg/opt19.adb
new file mode 100644
index 00000000000..5619da12215
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt19.adb
@@ -0,0 +1,27 @@
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+procedure Opt19 is
+
+ type Enum is (One, Two);
+
+ type Vector_T is array (Enum) of Integer;
+
+ Zero_Vector : constant Vector_T := (Enum => 0);
+
+ type T is record
+ Vector : Vector_T;
+ end record;
+
+ procedure Nested (Value : in out T; E : Enum; B : out Boolean) is
+ I : Integer renames Value.Vector(E);
+ begin
+ B := I /= 0;
+ end;
+
+ Obj : T := (Vector => Zero_Vector);
+ B : Boolean;
+
+begin
+ Nested (Obj, One, B);
+end;