+2015-10-16 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR middle-end/67966
+ * gnat.dg/pack21.adb: New test.
+ * gnat.dg/pack22.adb: Likewise.
+ * gnat.dg/pack22_pkg.ad[sb]: New helper.
+
2015-10-16 Christian Bruel <christian.bruel@st.com>
PR target/67745
- * gcc.target/arm/no-align.c: New test.
- * gcc.target/arm/attr-align1.c: New test.
- * gcc.target/arm/attr-align2.c: New test.
- * gcc.target/arm/attr-align3.c: New test.
+ * gcc.target/arm/no-align.c: New test.
+ * gcc.target/arm/attr-align1.c: New test.
+ * gcc.target/arm/attr-align2.c: New test.
+ * gcc.target/arm/attr-align3.c: New test.
2015-10-11 Jan Hubicka <hubicka@ucw.cz>
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-gnatws" }
+
+procedure Pack21 is
+
+ type Enum is (ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX,
+ SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELVE,
+ THIRTEEN, FOURTEEN, FIFTEEN);
+
+ type Rec1 is record
+ I1 : INTEGER range 0 .. 800;
+ I2 : INTEGER range 0 .. 15 := 0;
+ E : Enum;
+ end record;
+ pragma PACK (Rec1);
+
+ type Rec2 is record
+ F : Rec1;
+ end record;
+
+ for Rec2 use record
+ F at 0 range 2 .. 19;
+ end record;
+
+ R1, R2 : Rec2;
+
+begin
+ null;
+end;
--- /dev/null
+-- { dg-do compile }\r
+-- { dg-options "-O -gnatws" }\r
+\r
+with Pack22_Pkg; use Pack22_Pkg;\r
+\r
+procedure Pack22 is\r
+\r
+ package Role_Map is new Bit_Map_Generic;\r
+\r
+ type Role_List is new Role_Map.List;\r
+ Roles_1 : Role_List;\r
+ Roles_2 : Role_List;\r
+ Roles_3 : Role_List;\r
+\r
+begin\r
+ Temp_buffer := (others => 1);\r
+ Temp_Buffer(2) := (0);\r
+ Roles_1 := Roles_2 xor Roles_3;\r
+end;\r
--- /dev/null
+package body Pack22_Pkg is\r
+\r
+ package body Bit_Map_Generic is\r
+\r
+ function "xor" (L, R : List) return List is\r
+ Temp : List;\r
+ for Temp'address use Temp_buffer'address;\r
+ begin\r
+ Temp.Bits := L.Bits xor R.Bits;\r
+ Temp.Counter.Counter := 0;\r
+ return Temp;\r
+ end;\r
+\r
+ end Bit_Map_Generic;\r
+\r
+end Pack22_Pkg;\r
--- /dev/null
+package Pack22_Pkg is\r
+\r
+ type byte is mod 256;\r
+ Temp_buffer : array (0..8) of byte:= (others => 0);\r
+ for Temp_buffer'Alignment use 2;\r
+\r
+ subtype Id is Short_integer;\r
+\r
+ generic\r
+ Dummy : Integer := 0;\r
+ package Bit_Map_Generic is\r
+\r
+ type List is private;\r
+ function "xor" (L, R : List) return List;\r
+\r
+ private\r
+ type Offset_T is range 0 .. Id'Last;\r
+ type Counter_T is new short_integer;\r
+ for Counter_T'Size use 16;\r
+\r
+ type Bit_List is array (Id range <>) of Boolean;\r
+ pragma Pack (Bit_List);\r
+\r
+ type List_Counter_T (Is_Defined : Boolean := True) is\r
+ record\r
+ Dummy : Boolean := False;\r
+ case Is_Defined is\r
+ when True =>\r
+ Counter : Counter_T := 0;\r
+ when False =>\r
+ null;\r
+ end case;\r
+ end record;\r
+ for List_Counter_T use\r
+ record\r
+ Is_Defined at 0 range 0 .. 7;\r
+ Dummy at 1 range 0 .. 7;\r
+ Counter at 2 range 0 .. 15;\r
+ end record;\r
+\r
+ type List is\r
+ record\r
+ Offset : Offset_T := Offset_T (1) - 1;\r
+ Counter : List_Counter_T;\r
+ Bits : Bit_List (1 .. 6);\r
+ end record;\r
+ for List use\r
+ record\r
+ Offset at 0 range 0 .. 15;\r
+ Counter at 2 range 0 .. 31;\r
+ end record;\r
+\r
+ type Iterator is\r
+ record\r
+ No_More_Id : Boolean := True;\r
+ Current_Id : Id;\r
+ The_List : List;\r
+ end record;\r
+\r
+ end Bit_Map_Generic;\r
+\r
+end Pack22_Pkg;\r