summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/rep_clause3.adb
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gnat.dg/rep_clause3.adb
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
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.
Diffstat (limited to 'gcc/testsuite/gnat.dg/rep_clause3.adb')
-rw-r--r--gcc/testsuite/gnat.dg/rep_clause3.adb47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/rep_clause3.adb b/gcc/testsuite/gnat.dg/rep_clause3.adb
new file mode 100644
index 000000000..f4adcc37b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/rep_clause3.adb
@@ -0,0 +1,47 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws" }
+
+procedure Rep_Clause3 is
+
+ subtype U_16 is integer range 0..2**16-1;
+
+ type TYPE1 is range 0 .. 135;
+ for TYPE1'size use 14;
+
+ type TYPE2 is range 0 .. 262_143;
+ for TYPE2'size use 18;
+
+ subtype TYPE3 is integer range 1 .. 21*6;
+
+ type ARR is array (TYPE3 range <>) of boolean;
+ pragma Pack(ARR);
+
+ subtype SUB_ARR is ARR(1 .. 5*6);
+
+ OBJ : SUB_ARR;
+
+ type R is
+ record
+ N : TYPE1;
+ L : TYPE2;
+ I : SUB_ARR;
+ CRC : U_16;
+ end record;
+ for R use
+ record at mod 4;
+ N at 0 range 0 .. 13;
+ L at 0 range 14 .. 31;
+ I at 4 range 2 .. 37;
+ CRC at 8 range 16 .. 31;
+ end record;
+ for R'size use 12*8;
+
+ type SUB_R is array (1..4) of R;
+
+ T : SUB_R;
+
+begin
+ if OBJ = T(1).I then
+ raise Program_Error;
+ end if;
+end;