summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/oconst4.ads
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/oconst4.ads
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/oconst4.ads')
-rw-r--r--gcc/testsuite/gnat.dg/oconst4.ads66
1 files changed, 66 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/oconst4.ads b/gcc/testsuite/gnat.dg/oconst4.ads
new file mode 100644
index 000000000..cde0935fe
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/oconst4.ads
@@ -0,0 +1,66 @@
+package OCONST4 is
+
+ type bit is (zero, one);
+ type u2 is mod 2**2;
+ type u5 is mod 2**5;
+ type u8 is mod 2**8;
+
+ type Base is record
+ f1 : bit;
+ f2 : u2;
+ f3 : u5;
+ f4 : u8;
+ end record;
+
+ for Base use record
+ f1 at 0 range 0 .. 0;
+ f2 at 0 range 1 .. 2;
+ f3 at 0 range 3 .. 7;
+ f4 at 1 range 0 .. 7;
+ end record;
+
+ type Derived is record
+ f1 : u5;
+ b : Base;
+ f2 : bit;
+ f3 : u2;
+ f4 : u8;
+ i1 : Integer;
+ i2 : Integer;
+ end record;
+
+ for Derived use record
+ f1 at 0 range 0 .. 4;
+ b at 0 range 5 .. 20; -- unaligned HImode bitfield
+ f2 at 0 range 21 .. 21;
+ f3 at 0 range 22 .. 23;
+ f4 at 0 range 24 .. 31;
+ i1 at 4 range 0 .. 31;
+ i2 at 8 range 0 .. 31;
+ end record;
+
+ type R is record
+ u : u8;
+ d : Derived;
+ end record;
+
+ for R use record
+ u at 0 range 0 .. 7;
+ d at 1 range 0 .. 95; -- BLKmode bitfield
+ end record;
+
+ My_R : constant R := (u=>1,
+ d=>(f1=>17,
+ b=>(f1=>one,
+ f2=>2,
+ f3=>17,
+ f4=>42),
+ f2=>one,
+ f3=>1,
+ f4=>111,
+ i1=>2,
+ i2=>3));
+
+ procedure check (arg : R);
+
+end;