From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gnat.dg/alignment2.adb | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 gcc/testsuite/gnat.dg/alignment2.adb (limited to 'gcc/testsuite/gnat.dg/alignment2.adb') diff --git a/gcc/testsuite/gnat.dg/alignment2.adb b/gcc/testsuite/gnat.dg/alignment2.adb new file mode 100644 index 000000000..9f1be3c59 --- /dev/null +++ b/gcc/testsuite/gnat.dg/alignment2.adb @@ -0,0 +1,47 @@ +-- { dg-do run } + +procedure alignment2 is + + pragma COMPONENT_ALIGNMENT(STORAGE_UNIT); + + MAX_LIST_SIZE : constant INTEGER := 128*16; + + LEVEL2_SIZE : constant INTEGER := 128; + + LEVEL1_SIZE : constant INTEGER + := (MAX_LIST_SIZE - 1) / LEVEL2_SIZE + 1; + + type LEVEL2_ARRAY_TYPE is + array (1..LEVEL2_SIZE) of Integer; + + type LEVEL2_TYPE is + record + NUM : INTEGER := 0; + DATA : LEVEL2_ARRAY_TYPE := ( others => 0 ); + end record; + + type LEVEL2_PTR_TYPE is access all LEVEL2_TYPE; + + type LEVEL1_ARRAY_TYPE is + array( 1..LEVEL1_SIZE ) of LEVEL2_PTR_TYPE; + + type LEVEL1_TYPE is + record + LAST_LINE : INTEGER := 0; + LEVEL2_PTR : LEVEL1_ARRAY_TYPE; + end record; + + L1 : LEVEL1_TYPE; + L2 : aliased LEVEL2_TYPE; + + procedure q (LA : in out LEVEL1_ARRAY_TYPE) is + begin + LA (1) := L2'Access; + end; + +begin + q (L1.LEVEL2_PTR); + if L1.LEVEL2_PTR (1) /= L2'Access then + raise Program_Error; + end if; +end; -- cgit v1.2.3