* gnat.dg/discr38.adb: Don't use ^M line endings.
gnat.dg/loop_optimization13.adb: Likewise.
gnat.dg/loop_optimization13.ads: Likewise.
gnat.dg/discr36_pkg.adb: Likewise.
gnat.dg/discr36_pkg.ads: Likewise.
gnat.dg/loop_optimization11_pkg.ads: Likewise.
gnat.dg/discr36.ads: Likewise.
gnat.dg/loop_optimization11.adb: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194309
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-12-07 Mike Stump <mikestump@comcast.net>
+
+ * gnat.dg/discr38.adb: Don't use ^M line endings.
+ gnat.dg/loop_optimization13.adb: Likewise.
+ gnat.dg/loop_optimization13.ads: Likewise.
+ gnat.dg/discr36_pkg.adb: Likewise.
+ gnat.dg/discr36_pkg.ads: Likewise.
+ gnat.dg/loop_optimization11_pkg.ads: Likewise.
+ gnat.dg/discr36.ads: Likewise.
+ gnat.dg/loop_optimization11.adb: Likewise.
+
2012-12-07 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/55141
-package Discr36 is\r
-\r
- type R (D : Boolean := True) is record\r
- case D is\r
- when True => I : Integer;\r
- when False => null;\r
- end case;\r
- end record;\r
-\r
- function N return Natural;\r
-\r
-end Discr36;\r
+package Discr36 is
+
+ type R (D : Boolean := True) is record
+ case D is
+ when True => I : Integer;
+ when False => null;
+ end case;
+ end record;
+
+ function N return Natural;
+
+end Discr36;
-package body Discr36_Pkg is\r
-\r
- function Func return T is\r
- Ret : T;\r
- pragma Warnings (Off, Ret);\r
- begin\r
- return Ret;\r
- end;\r
-\r
-end Discr36_Pkg;\r
+package body Discr36_Pkg is
+
+ function Func return T is
+ Ret : T;
+ pragma Warnings (Off, Ret);
+ begin
+ return Ret;
+ end;
+
+end Discr36_Pkg;
-package Discr36_Pkg is\r
-\r
- generic\r
- type T is private;\r
- function Func return T;\r
-\r
-end Discr36_Pkg;\r
+package Discr36_Pkg is
+
+ generic
+ type T is private;
+ function Func return T;
+
+end Discr36_Pkg;
--- { dg-do compile }\r
-\r
-procedure Discr38 is\r
-\r
- type Enum is (OK,\r
- NOT_CONNECTED,\r
- DISCONNECTED,\r
- REQUEST_Q_EMPTY,\r
- SERVER_UNAVAILABLE,\r
- BUFFER_TOO_SMALL,\r
- NO_FREE_SLOT,\r
- RAISE_EXCEPTION,\r
- REQUEST_CANCELLED,\r
- REQUEST_IN_PROGRESS,\r
- SERVER_BUSY,\r
- BLOCK_ACKNOWLEDGE);\r
-\r
- type R (Status : Enum := OK) is record\r
- Status_Block : Integer;\r
- case Status is\r
- when RAISE_EXCEPTION =>\r
- I : Integer;\r
- when OK =>\r
- Length : Natural;\r
- Data : Integer;\r
- when others =>\r
- null;\r
- end case;\r
- end record;\r
- for R use record\r
- Status at 0 range 0 .. 7;\r
- Status_Block at 4 range 0 .. 31;\r
- Length at 8 range 0 .. 31;\r
- end record;\r
-\r
- Nil : constant R := (OK, 1, 0, 1);\r
-\r
-begin\r
- null;\r
-end;\r
+-- { dg-do compile }
+
+procedure Discr38 is
+
+ type Enum is (OK,
+ NOT_CONNECTED,
+ DISCONNECTED,
+ REQUEST_Q_EMPTY,
+ SERVER_UNAVAILABLE,
+ BUFFER_TOO_SMALL,
+ NO_FREE_SLOT,
+ RAISE_EXCEPTION,
+ REQUEST_CANCELLED,
+ REQUEST_IN_PROGRESS,
+ SERVER_BUSY,
+ BLOCK_ACKNOWLEDGE);
+
+ type R (Status : Enum := OK) is record
+ Status_Block : Integer;
+ case Status is
+ when RAISE_EXCEPTION =>
+ I : Integer;
+ when OK =>
+ Length : Natural;
+ Data : Integer;
+ when others =>
+ null;
+ end case;
+ end record;
+ for R use record
+ Status at 0 range 0 .. 7;
+ Status_Block at 4 range 0 .. 31;
+ Length at 8 range 0 .. 31;
+ end record;
+
+ Nil : constant R := (OK, 1, 0, 1);
+
+begin
+ null;
+end;
--- { dg-do compile }\r
--- { dg-options "-O" }\r
-\r
-with Loop_Optimization11_Pkg; use Loop_Optimization11_Pkg;\r
-\r
-procedure Loop_Optimization11 is\r
- Arr : array (Prot, Mem) of Integer := (others => (others => 0));\r
-begin\r
- Put_Line (Img (0) & " ");\r
- for I in Arr'Range (1) loop\r
- for J in Arr'Range (2) loop\r
- declare\r
- Elem : Integer renames Arr (I, J);\r
- begin\r
- Put_Line (Img (Elem));\r
- end;\r
- end loop;\r
- end loop;\r
-end;\r
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+with Loop_Optimization11_Pkg; use Loop_Optimization11_Pkg;
+
+procedure Loop_Optimization11 is
+ Arr : array (Prot, Mem) of Integer := (others => (others => 0));
+begin
+ Put_Line (Img (0) & " ");
+ for I in Arr'Range (1) loop
+ for J in Arr'Range (2) loop
+ declare
+ Elem : Integer renames Arr (I, J);
+ begin
+ Put_Line (Img (Elem));
+ end;
+ end loop;
+ end loop;
+end;
-package Loop_Optimization11_Pkg is\r
-\r
- function Img (X : Integer) return String;\r
-\r
- procedure Put_Line (Data : String);\r
-\r
- type Prot is (Execute, Execute_Read, Execute_Read_Write);\r
-\r
- type Mem is (Mem_Image, Mem_Mapped, Mem_Private, Unknown);\r
-\r
-end Loop_Optimization11_Pkg;\r
+package Loop_Optimization11_Pkg is
+
+ function Img (X : Integer) return String;
+
+ procedure Put_Line (Data : String);
+
+ type Prot is (Execute, Execute_Read, Execute_Read_Write);
+
+ type Mem is (Mem_Image, Mem_Mapped, Mem_Private, Unknown);
+
+end Loop_Optimization11_Pkg;
--- { dg-do compile }\r
--- { dg-options "-O" }\r
-\r
-with Loop_Optimization13_Pkg; use Loop_Optimization13_Pkg;\r
-\r
-package body Loop_Optimization13 is\r
-\r
- function F (A : Rec) return Rec is\r
- N : constant Integer := A.V'Length / L;\r
- Res : Rec\r
- := (True, new Complex_Vector' (0 .. A.V'Length / L - 1 => (0.0, 0.0)));\r
- begin\r
- for I in 0 .. L - 1 loop\r
- for J in 0 .. N - 1 loop\r
- Res.V (J) := Res.V (J) + A.V (I * N + J);\r
- end loop;\r
- end loop;\r
- return Res;\r
- end;\r
-\r
-end Loop_Optimization13;\r
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+with Loop_Optimization13_Pkg; use Loop_Optimization13_Pkg;
+
+package body Loop_Optimization13 is
+
+ function F (A : Rec) return Rec is
+ N : constant Integer := A.V'Length / L;
+ Res : Rec
+ := (True, new Complex_Vector' (0 .. A.V'Length / L - 1 => (0.0, 0.0)));
+ begin
+ for I in 0 .. L - 1 loop
+ for J in 0 .. N - 1 loop
+ Res.V (J) := Res.V (J) + A.V (I * N + J);
+ end loop;
+ end loop;
+ return Res;
+ end;
+
+end Loop_Optimization13;
-with Ada.Numerics.Complex_Types; use Ada.Numerics.Complex_Types;\r
-\r
-package Loop_Optimization13 is\r
-\r
- type Complex_Vector is array (Integer range <>) of Complex;\r
- type Complex_Vector_Ptr is access Complex_Vector;\r
-\r
- type Rec (Kind : Boolean := False) is record\r
- case Kind is\r
- when True => V : Complex_Vector_Ptr;\r
- when False => null;\r
- end case;\r
- end record;\r
-\r
- function F (A : Rec) return Rec;\r
-\r
-end Loop_Optimization13;\r
+with Ada.Numerics.Complex_Types; use Ada.Numerics.Complex_Types;
+
+package Loop_Optimization13 is
+
+ type Complex_Vector is array (Integer range <>) of Complex;
+ type Complex_Vector_Ptr is access Complex_Vector;
+
+ type Rec (Kind : Boolean := False) is record
+ case Kind is
+ when True => V : Complex_Vector_Ptr;
+ when False => null;
+ end case;
+ end record;
+
+ function F (A : Rec) return Rec;
+
+end Loop_Optimization13;