diff options
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r-- | gcc/testsuite/gnat.dg/specs/pack6.ads | 24 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/specs/pack6_pkg.ads | 17 |
2 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/specs/pack6.ads b/gcc/testsuite/gnat.dg/specs/pack6.ads new file mode 100644 index 00000000000..cf1813d144b --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/pack6.ads @@ -0,0 +1,24 @@ +-- { dg-do compile } + +with Ada.Finalization; +with Pack6_Pkg; + +package Pack6 is + + package Eight_Bits is new Pack6_Pkg (8); + + type Some_Data is record + Byte_1 : Eight_Bits.Object; + Byte_2 : Eight_Bits.Object; + end record; + + for Some_Data use record + Byte_1 at 0 range 0 .. 7; + Byte_2 at 1 range 0 .. 7; + end record; + + type Top_Object is new Ada.Finalization.Controlled with record + Data : Some_Data; + end record; + +end Pack6; diff --git a/gcc/testsuite/gnat.dg/specs/pack6_pkg.ads b/gcc/testsuite/gnat.dg/specs/pack6_pkg.ads new file mode 100644 index 00000000000..52ded342d4b --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/pack6_pkg.ads @@ -0,0 +1,17 @@ +generic + + Size : Positive; + +package Pack6_Pkg is + + type Object is private; + +private + + type Bit is range 0 .. 1; + for Bit'Size use 1; + + type Object is array (1 .. Size) of Bit; + pragma Pack (Object); + +end Pack6_Pkg; |