Commit 9b1baeef by Mike Stump Committed by Mike Stump

discr38.adb: Don't use ^M line endings.

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.

From-SVN: r194309
parent 9011b0f6
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> 2012-12-07 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/55141 PR rtl-optimization/55141
......
package Discr36 is package Discr36 is
type R (D : Boolean := True) is record type R (D : Boolean := True) is record
case D is case D is
when True => I : Integer; when True => I : Integer;
when False => null; when False => null;
end case; end case;
end record; end record;
function N return Natural; function N return Natural;
end Discr36; end Discr36;
package body Discr36_Pkg is package body Discr36_Pkg is
function Func return T is function Func return T is
Ret : T; Ret : T;
pragma Warnings (Off, Ret); pragma Warnings (Off, Ret);
begin begin
return Ret; return Ret;
end; end;
end Discr36_Pkg; end Discr36_Pkg;
package Discr36_Pkg is package Discr36_Pkg is
generic generic
type T is private; type T is private;
function Func return T; function Func return T;
end Discr36_Pkg; end Discr36_Pkg;
-- { dg-do compile } -- { dg-do compile }
procedure Discr38 is procedure Discr38 is
type Enum is (OK, type Enum is (OK,
NOT_CONNECTED, NOT_CONNECTED,
DISCONNECTED, DISCONNECTED,
REQUEST_Q_EMPTY, REQUEST_Q_EMPTY,
SERVER_UNAVAILABLE, SERVER_UNAVAILABLE,
BUFFER_TOO_SMALL, BUFFER_TOO_SMALL,
NO_FREE_SLOT, NO_FREE_SLOT,
RAISE_EXCEPTION, RAISE_EXCEPTION,
REQUEST_CANCELLED, REQUEST_CANCELLED,
REQUEST_IN_PROGRESS, REQUEST_IN_PROGRESS,
SERVER_BUSY, SERVER_BUSY,
BLOCK_ACKNOWLEDGE); BLOCK_ACKNOWLEDGE);
type R (Status : Enum := OK) is record type R (Status : Enum := OK) is record
Status_Block : Integer; Status_Block : Integer;
case Status is case Status is
when RAISE_EXCEPTION => when RAISE_EXCEPTION =>
I : Integer; I : Integer;
when OK => when OK =>
Length : Natural; Length : Natural;
Data : Integer; Data : Integer;
when others => when others =>
null; null;
end case; end case;
end record; end record;
for R use record for R use record
Status at 0 range 0 .. 7; Status at 0 range 0 .. 7;
Status_Block at 4 range 0 .. 31; Status_Block at 4 range 0 .. 31;
Length at 8 range 0 .. 31; Length at 8 range 0 .. 31;
end record; end record;
Nil : constant R := (OK, 1, 0, 1); Nil : constant R := (OK, 1, 0, 1);
begin begin
null; null;
end; end;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-O" } -- { dg-options "-O" }
with Loop_Optimization11_Pkg; use Loop_Optimization11_Pkg; with Loop_Optimization11_Pkg; use Loop_Optimization11_Pkg;
procedure Loop_Optimization11 is procedure Loop_Optimization11 is
Arr : array (Prot, Mem) of Integer := (others => (others => 0)); Arr : array (Prot, Mem) of Integer := (others => (others => 0));
begin begin
Put_Line (Img (0) & " "); Put_Line (Img (0) & " ");
for I in Arr'Range (1) loop for I in Arr'Range (1) loop
for J in Arr'Range (2) loop for J in Arr'Range (2) loop
declare declare
Elem : Integer renames Arr (I, J); Elem : Integer renames Arr (I, J);
begin begin
Put_Line (Img (Elem)); Put_Line (Img (Elem));
end; end;
end loop; end loop;
end loop; end loop;
end; end;
package Loop_Optimization11_Pkg is package Loop_Optimization11_Pkg is
function Img (X : Integer) return String; function Img (X : Integer) return String;
procedure Put_Line (Data : String); procedure Put_Line (Data : String);
type Prot is (Execute, Execute_Read, Execute_Read_Write); type Prot is (Execute, Execute_Read, Execute_Read_Write);
type Mem is (Mem_Image, Mem_Mapped, Mem_Private, Unknown); type Mem is (Mem_Image, Mem_Mapped, Mem_Private, Unknown);
end Loop_Optimization11_Pkg; end Loop_Optimization11_Pkg;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-O" } -- { dg-options "-O" }
with Loop_Optimization13_Pkg; use Loop_Optimization13_Pkg; with Loop_Optimization13_Pkg; use Loop_Optimization13_Pkg;
package body Loop_Optimization13 is package body Loop_Optimization13 is
function F (A : Rec) return Rec is function F (A : Rec) return Rec is
N : constant Integer := A.V'Length / L; N : constant Integer := A.V'Length / L;
Res : Rec Res : Rec
:= (True, new Complex_Vector' (0 .. A.V'Length / L - 1 => (0.0, 0.0))); := (True, new Complex_Vector' (0 .. A.V'Length / L - 1 => (0.0, 0.0)));
begin begin
for I in 0 .. L - 1 loop for I in 0 .. L - 1 loop
for J in 0 .. N - 1 loop for J in 0 .. N - 1 loop
Res.V (J) := Res.V (J) + A.V (I * N + J); Res.V (J) := Res.V (J) + A.V (I * N + J);
end loop; end loop;
end loop; end loop;
return Res; return Res;
end; end;
end Loop_Optimization13; end Loop_Optimization13;
with Ada.Numerics.Complex_Types; use Ada.Numerics.Complex_Types; with Ada.Numerics.Complex_Types; use Ada.Numerics.Complex_Types;
package Loop_Optimization13 is package Loop_Optimization13 is
type Complex_Vector is array (Integer range <>) of Complex; type Complex_Vector is array (Integer range <>) of Complex;
type Complex_Vector_Ptr is access Complex_Vector; type Complex_Vector_Ptr is access Complex_Vector;
type Rec (Kind : Boolean := False) is record type Rec (Kind : Boolean := False) is record
case Kind is case Kind is
when True => V : Complex_Vector_Ptr; when True => V : Complex_Vector_Ptr;
when False => null; when False => null;
end case; end case;
end record; end record;
function F (A : Rec) return Rec; function F (A : Rec) return Rec;
end Loop_Optimization13; end Loop_Optimization13;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment