aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gnat.dg/outer_agg_bitfield_constructor.adb
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
committerBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
commit1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch)
treec607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/gnat.dg/outer_agg_bitfield_constructor.adb
parent283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff)
downloadtoolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gnat.dg/outer_agg_bitfield_constructor.adb')
-rw-r--r--gcc-4.9/gcc/testsuite/gnat.dg/outer_agg_bitfield_constructor.adb44
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/outer_agg_bitfield_constructor.adb b/gcc-4.9/gcc/testsuite/gnat.dg/outer_agg_bitfield_constructor.adb
new file mode 100644
index 000000000..6658042e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gnat.dg/outer_agg_bitfield_constructor.adb
@@ -0,0 +1,44 @@
+-- { dg-do run }
+
+procedure Outer_Agg_Bitfield_Constructor is
+
+ type Mod_64 is mod 2 ** 64;
+ for Mod_64'Size use 64;
+
+ type Uint_16 is range 0 .. 2 ** 16 - 1;
+ for Uint_16'Size use 16;
+
+ type Values_Type is record
+ M64 : Mod_64;
+ U16 : Uint_16;
+ end record;
+
+ for Values_Type use record
+ M64 at 0 range 0 .. 63;
+ U16 at 8 range 0 .. 15;
+ end record;
+
+ type Wrapper_Type is record
+ Values : Values_Type;
+ end record;
+
+ for Wrapper_Type use record
+ Values at 0 range 0 .. 79;
+ end record;
+
+ M : constant := 2;
+ U : constant := 4;
+
+ W : Wrapper_Type := (Values => (M, U));
+
+ procedure Check (O : Wrapper_Type) is
+ begin
+ if O.Values.M64 /= M or else O.Values.U16 /= U then
+ raise Program_Error;
+ end if;
+ end;
+begin
+ Check (W);
+end;
+
+