Commit bcc2b4cd by Mike Stump Committed by Mike Stump

Don't use CRLF endings.

	* gcc.dg/tree-ssa/vrp59.c: Likewise.
	* gcc.dg/tree-ssa/vrp60.c: Likewise.
	* gnat.dg/aggr11.adb: Likewise.
	* gnat.dg/aggr11_pkg.ads: Likewise.
	* gnat.dg/aggr15.adb: Likewise.
	* gnat.dg/aggr15.ads: Likewise.
	* gnat.dg/aggr17.adb: Likewise.
	* gnat.dg/aggr18.adb: Likewise.
	* gnat.dg/array14.adb: Likewise.
	* gnat.dg/array14.ads: Likewise.
	* gnat.dg/array14_pkg.ads: Likewise.
	* gnat.dg/array19.adb: Likewise.
	* gnat.dg/array19.ads: Likewise.
	* gnat.dg/discr27.adb: Likewise.
	* gnat.dg/discr27.ads: Likewise.
	* gnat.dg/discr35.adb: Likewise.
	* gnat.dg/discr35.ads: Likewise.
	* gnat.dg/discr6.adb: Likewise.
	* gnat.dg/discr6_pkg.ads: Likewise.
	* gnat.dg/import1.adb: Likewise.
	* gnat.dg/import1.ads: Likewise.
	* gnat.dg/loop_address2.adb: Likewise.
	* gnat.dg/opt7.adb: Likewise.
	* gnat.dg/opt7.ads: Likewise.
	* gnat.dg/pointer_variable_bounds.adb: Likewise.
	* gnat.dg/pointer_variable_bounds.ads: Likewise.
	* gnat.dg/rep_clause2.adb: Likewise.
	* gnat.dg/rep_clause2.ads: Likewise.
	* gnat.dg/slice2.adb: Likewise.
	* gnat.dg/slice2.ads: Likewise.
	* gnat.dg/slice6.adb: Likewise.
	* gnat.dg/slice6_pkg.ads: Likewise.
	* gnat.dg/specs/unchecked_union2.ads: Likewise.
	* gnat.dg/taft_type2.adb: Likewise.
	* gnat.dg/taft_type2.ads: Likewise.
	* gnat.dg/taft_type2_pkg.ads: Likewise.
	* gnat.dg/volatile10.adb: Likewise.
	* gnat.dg/volatile10_pkg.ads: Likewise.

From-SVN: r186265
parent b832b14d
...@@ -3,6 +3,42 @@ ...@@ -3,6 +3,42 @@
* g++.dg/cpp0x/udlit-raw-op.C: Don't use CRLF endings. * g++.dg/cpp0x/udlit-raw-op.C: Don't use CRLF endings.
* gcc.dg/tree-ssa/vrp59.c: Likewise. * gcc.dg/tree-ssa/vrp59.c: Likewise.
* gcc.dg/tree-ssa/vrp60.c: Likewise. * gcc.dg/tree-ssa/vrp60.c: Likewise.
* gnat.dg/aggr11.adb: Likewise.
* gnat.dg/aggr11_pkg.ads: Likewise.
* gnat.dg/aggr15.adb: Likewise.
* gnat.dg/aggr15.ads: Likewise.
* gnat.dg/aggr17.adb: Likewise.
* gnat.dg/aggr18.adb: Likewise.
* gnat.dg/array14.adb: Likewise.
* gnat.dg/array14.ads: Likewise.
* gnat.dg/array14_pkg.ads: Likewise.
* gnat.dg/array19.adb: Likewise.
* gnat.dg/array19.ads: Likewise.
* gnat.dg/discr27.adb: Likewise.
* gnat.dg/discr27.ads: Likewise.
* gnat.dg/discr35.adb: Likewise.
* gnat.dg/discr35.ads: Likewise.
* gnat.dg/discr6.adb: Likewise.
* gnat.dg/discr6_pkg.ads: Likewise.
* gnat.dg/import1.adb: Likewise.
* gnat.dg/import1.ads: Likewise.
* gnat.dg/loop_address2.adb: Likewise.
* gnat.dg/opt7.adb: Likewise.
* gnat.dg/opt7.ads: Likewise.
* gnat.dg/pointer_variable_bounds.adb: Likewise.
* gnat.dg/pointer_variable_bounds.ads: Likewise.
* gnat.dg/rep_clause2.adb: Likewise.
* gnat.dg/rep_clause2.ads: Likewise.
* gnat.dg/slice2.adb: Likewise.
* gnat.dg/slice2.ads: Likewise.
* gnat.dg/slice6.adb: Likewise.
* gnat.dg/slice6_pkg.ads: Likewise.
* gnat.dg/specs/unchecked_union2.ads: Likewise.
* gnat.dg/taft_type2.adb: Likewise.
* gnat.dg/taft_type2.ads: Likewise.
* gnat.dg/taft_type2_pkg.ads: Likewise.
* gnat.dg/volatile10.adb: Likewise.
* gnat.dg/volatile10_pkg.ads: Likewise.
* gcc.dg/dll-8.c: Remove execute permissions. * gcc.dg/dll-8.c: Remove execute permissions.
* g++.dg/ext/dllexport5.C: Likewise. * g++.dg/ext/dllexport5.C: Likewise.
......
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-O" } -- { dg-options "-O" }
with Aggr11_Pkg; use Aggr11_Pkg; with Aggr11_Pkg; use Aggr11_Pkg;
procedure Aggr11 is procedure Aggr11 is
A : Arr := ((1 => (Kind => No_Error, B => True), A : Arr := ((1 => (Kind => No_Error, B => True),
2 => (Kind => Error), 2 => (Kind => Error),
3 => (Kind => Error), 3 => (Kind => Error),
4 => (Kind => No_Error, B => True), 4 => (Kind => No_Error, B => True),
5 => (Kind => No_Error, B => True), 5 => (Kind => No_Error, B => True),
6 => (Kind => No_Error, B => True))); 6 => (Kind => No_Error, B => True)));
begin begin
null; null;
end; end;
package Aggr11_Pkg is package Aggr11_Pkg is
type Error_Type is (No_Error, Error); type Error_Type is (No_Error, Error);
type Rec (Kind : Error_Type := No_Error) is record type Rec (Kind : Error_Type := No_Error) is record
case Kind is case Kind is
when Error => null; when Error => null;
when others => B : Boolean; when others => B : Boolean;
end case; end case;
end record; end record;
type Arr is array (1..6) of Rec; type Arr is array (1..6) of Rec;
end Aggr11_Pkg; end Aggr11_Pkg;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-gnatws" } -- { dg-options "-gnatws" }
package body Aggr15 is package body Aggr15 is
function CREATE return DATA_T is function CREATE return DATA_T is
D : DATA_T; D : DATA_T;
begin begin
return D; return D;
end; end;
function ALL_CREATE return ALL_DATA_T is function ALL_CREATE return ALL_DATA_T is
C : constant ALL_DATA_T := (others => (others => Create)); C : constant ALL_DATA_T := (others => (others => Create));
begin begin
return C; return C;
end; end;
end Aggr15; end Aggr15;
package Aggr15 is package Aggr15 is
type T is tagged record type T is tagged record
I : Integer; I : Integer;
end record; end record;
type DATA_T is record type DATA_T is record
D : T; D : T;
end record; end record;
type ALL_DATA_T is array (1..2, 1..2) of DATA_T; type ALL_DATA_T is array (1..2, 1..2) of DATA_T;
function ALL_CREATE return ALL_DATA_T; function ALL_CREATE return ALL_DATA_T;
end Aggr15; end Aggr15;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-gnatws" } -- { dg-options "-gnatws" }
procedure Aggr17 is procedure Aggr17 is
type Enum is (A, B); type Enum is (A, B);
type Rec (D : Enum := Enum'First) is record type Rec (D : Enum := Enum'First) is record
case D is case D is
when A => X : Integer; when A => X : Integer;
when B => null; when B => null;
end case; end case;
end record; end record;
for Rec'Size use 128; for Rec'Size use 128;
pragma Volatile (Rec); pragma Volatile (Rec);
type Config_T (D : Enum := Enum'First) is record type Config_T (D : Enum := Enum'First) is record
N : Natural; N : Natural;
R : Rec (D); R : Rec (D);
end record; end record;
C : constant Config_T := (D => A, N => 1, R => (D => A, X => 0)); C : constant Config_T := (D => A, N => 1, R => (D => A, X => 0));
type Arr is array (Natural range 1 .. C.N) of Boolean; type Arr is array (Natural range 1 .. C.N) of Boolean;
begin begin
null; null;
end; end;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-gnatws" } -- { dg-options "-gnatws" }
procedure Aggr18 is procedure Aggr18 is
type Enum is (A, B); type Enum is (A, B);
type Rec (D : Enum := Enum'First) is record type Rec (D : Enum := Enum'First) is record
case D is case D is
when A => X : Integer; when A => X : Integer;
when B => null; when B => null;
end case; end case;
end record; end record;
for Rec'Size use 128; for Rec'Size use 128;
pragma Volatile (Rec); pragma Volatile (Rec);
type Config_T (D : Enum := Enum'First) is record type Config_T (D : Enum := Enum'First) is record
N : Natural; N : Natural;
R : Rec (D); R : Rec (D);
end record; end record;
C : Config_T := (D => A, N => 1, R => (D => A, X => 0)); C : Config_T := (D => A, N => 1, R => (D => A, X => 0));
type Arr is array (Natural range 1 .. C.N) of Boolean; type Arr is array (Natural range 1 .. C.N) of Boolean;
begin begin
null; null;
end; end;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-gnatws" } -- { dg-options "-gnatws" }
with Array14_Pkg; use Array14_Pkg; with Array14_Pkg; use Array14_Pkg;
package body Array14 is package body Array14 is
package Nested is package Nested is
Length : constant SSE.Storage_Count := Length2; Length : constant SSE.Storage_Count := Length2;
subtype Encoded_Index_Type is SSE.Storage_Count range 1 .. Length; subtype Encoded_Index_Type is SSE.Storage_Count range 1 .. Length;
subtype Encoded_Type is SSE.Storage_Array (Encoded_Index_Type'Range); subtype Encoded_Type is SSE.Storage_Array (Encoded_Index_Type'Range);
procedure Encode (Input : in Integer; Output : out Encoded_Type); procedure Encode (Input : in Integer; Output : out Encoded_Type);
end; end;
package body Nested is package body Nested is
procedure Encode (Input : in Integer; Output : out Encoded_Type) is procedure Encode (Input : in Integer; Output : out Encoded_Type) is
begin begin
Encode2 (Input, Output); Encode2 (Input, Output);
end; end;
end; end;
procedure Init is procedure Init is
O : Nested.Encoded_Type; O : Nested.Encoded_Type;
for O'Alignment use 4; for O'Alignment use 4;
begin begin
null; null;
end; end;
end Array14; end Array14;
package Array14 is package Array14 is
procedure Init; procedure Init;
end Array14; end Array14;
with System.Storage_Elements; with System.Storage_Elements;
package Array14_Pkg is package Array14_Pkg is
package SSE renames System.Storage_Elements; package SSE renames System.Storage_Elements;
function Parity_Byte_Count return SSE.Storage_Count; function Parity_Byte_Count return SSE.Storage_Count;
Length2 : constant SSE.Storage_Count := Parity_Byte_Count; Length2 : constant SSE.Storage_Count := Parity_Byte_Count;
subtype Encoded_Index_Type2 is SSE.Storage_Count range 1 .. Length2; subtype Encoded_Index_Type2 is SSE.Storage_Count range 1 .. Length2;
subtype Encoded_Type2 is SSE.Storage_Array (Encoded_Index_Type2'Range); subtype Encoded_Type2 is SSE.Storage_Array (Encoded_Index_Type2'Range);
procedure Encode2 (Input : in Integer; Output : out Encoded_Type2); procedure Encode2 (Input : in Integer; Output : out Encoded_Type2);
end Array14_Pkg; end Array14_Pkg;
-- { dg-do compile } -- { dg-do compile }
package body Array19 is package body Array19 is
function N return Integer is function N return Integer is
begin begin
return 1; return 1;
end; end;
type Array_Type is array (1 .. N) of Float; type Array_Type is array (1 .. N) of Float;
type Enum is (One, Two); type Enum is (One, Two);
type Rec (D : Enum := Enum'First) is record type Rec (D : Enum := Enum'First) is record
case D is case D is
when One => null; when One => null;
when Two => A : Array_Type; when Two => A : Array_Type;
end case; end case;
end record; end record;
procedure Proc is procedure Proc is
R : Rec; R : Rec;
function F return Array_Type is function F return Array_Type is
begin begin
return (others => 0.0); return (others => 0.0);
end F; end F;
begin begin
R.A := F; R.A := F;
end; end;
end Array19; end Array19;
package Array19 is package Array19 is
procedure Proc; procedure Proc;
end Array19; end Array19;
-- { dg-do compile } -- { dg-do compile }
package body Discr27 is package body Discr27 is
subtype Index is Positive range 1..4096; subtype Index is Positive range 1..4096;
function F return String is function F return String is
S : String(1..1) := (others =>'w'); S : String(1..1) := (others =>'w');
begin begin
return S; return S;
end; end;
type Enum is (One, Two); type Enum is (One, Two);
type Rec (D : Enum := One; Len : Index := 1) is record type Rec (D : Enum := One; Len : Index := 1) is record
case D is case D is
when One => I : Integer; when One => I : Integer;
when Two => A : String(1..Len); when Two => A : String(1..Len);
end case; end case;
end record; end record;
procedure Nothing is procedure Nothing is
M : constant String := F; M : constant String := F;
C : constant Rec := (Two, M'Length, M); C : constant Rec := (Two, M'Length, M);
begin begin
null; null;
end; end;
procedure Proc is begin procedure Proc is begin
null; null;
end; end;
end Discr27; end Discr27;
package Discr27 is package Discr27 is
procedure Proc; procedure Proc;
end Discr27; end Discr27;
-- { dg-do compile } -- { dg-do compile }
package body Discr35 is package body Discr35 is
procedure Proc1 is procedure Proc1 is
R : Rec2 := Null_Rec2; R : Rec2 := Null_Rec2;
begin begin
null; null;
end; end;
procedure Proc2 is procedure Proc2 is
R : Rec2; R : Rec2;
begin begin
R := Null_Rec2; R := Null_Rec2;
end; end;
end Discr35; end Discr35;
package Discr35 is package Discr35 is
type Rec1 is tagged null record; type Rec1 is tagged null record;
type Enum is (One, Two); type Enum is (One, Two);
type Rec2 (D : Enum := One) is type Rec2 (D : Enum := One) is
record record
case D is case D is
when One => null; when One => null;
when Two => R : Rec1; when Two => R : Rec1;
end case; end case;
end record; end record;
Null_Rec2 : Constant Rec2; Null_Rec2 : Constant Rec2;
procedure Proc1; procedure Proc1;
procedure Proc2; procedure Proc2;
private private
Null_Rec2 : Constant Rec2 := (D => One); Null_Rec2 : Constant Rec2 := (D => One);
end Discr35; end Discr35;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-gnatdm -gnatws" } -- { dg-options "-gnatdm -gnatws" }
with Discr6_Pkg; with Discr6_Pkg;
procedure Discr6 is procedure Discr6 is
type T_Bit is range 0..1; type T_Bit is range 0..1;
type T_Entier_16 is range -2**15 .. 2**15-1; type T_Entier_16 is range -2**15 .. 2**15-1;
package My_Q is new Discr6_Pkg(T_Entier_16); package My_Q is new Discr6_Pkg(T_Entier_16);
type T_Valeur is (BIT, Entier_16); type T_Valeur is (BIT, Entier_16);
type R(D : T_Valeur) is record type R(D : T_Valeur) is record
case D is case D is
when BIT => V_BIT : T_Bit; when BIT => V_BIT : T_Bit;
when Entier_16 => V_E16 : T_Entier_16; when Entier_16 => V_E16 : T_Entier_16;
end case; end case;
end record; end record;
for R use record for R use record
V_BIT at 0 range 0..7; V_BIT at 0 range 0..7;
V_E16 at 0 range 0..15; V_E16 at 0 range 0..15;
D at 8 range 0..7; D at 8 range 0..7;
end record; end record;
for R'size use 128; for R'size use 128;
A : R(Entier_16); A : R(Entier_16);
I : Integer; I : Integer;
begin begin
I := My_Q.X(A.V_E16); I := My_Q.X(A.V_E16);
end; end;
generic generic
type T(<>) is private; type T(<>) is private;
package Discr6_Pkg is package Discr6_Pkg is
function X (A : T) return Integer; function X (A : T) return Integer;
pragma Interface(C, X); pragma Interface(C, X);
pragma IMPORT_FUNCTION ( pragma IMPORT_FUNCTION (
INTERNAL => X, INTERNAL => X,
EXTERNAL => X, EXTERNAL => X,
PARAMETER_TYPES => (T), PARAMETER_TYPES => (T),
MECHANISM => (Descriptor(S))); MECHANISM => (Descriptor(S)));
end Discr6_Pkg; end Discr6_Pkg;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-g" } -- { dg-options "-g" }
package body Import1 is package body Import1 is
procedure Create (Bounds : Arr) is procedure Create (Bounds : Arr) is
type Bound_Array is array (Bounds'Range) of Integer; type Bound_Array is array (Bounds'Range) of Integer;
procedure Proc (Ptr : access Bound_Array); procedure Proc (Ptr : access Bound_Array);
pragma Import (C, Proc); pragma Import (C, Proc);
Temp : aliased Bound_Array; Temp : aliased Bound_Array;
begin begin
Proc (Temp'Access); Proc (Temp'Access);
end; end;
end Import1; end Import1;
package Import1 is package Import1 is
type Arr is array (Positive range <>) of Integer; type Arr is array (Positive range <>) of Integer;
procedure Create (Bounds : Arr); procedure Create (Bounds : Arr);
end Import1; end Import1;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-O" } -- { dg-options "-O" }
with System, Ada.Unchecked_Conversion; with System, Ada.Unchecked_Conversion;
with System.Storage_Elements; use System.Storage_Elements; with System.Storage_Elements; use System.Storage_Elements;
procedure Loop_Address2 is procedure Loop_Address2 is
type Ptr is access all Integer; type Ptr is access all Integer;
function To_Ptr is new Ada.Unchecked_Conversion (System.Address, Ptr); function To_Ptr is new Ada.Unchecked_Conversion (System.Address, Ptr);
function F (BM : System.Address; I : Integer) return System.Address is function F (BM : System.Address; I : Integer) return System.Address is
begin begin
return BM + Storage_Offset (4*I); return BM + Storage_Offset (4*I);
end; end;
B : Integer; B : Integer;
P : Ptr; P : Ptr;
begin begin
for I in 0 .. 2 loop for I in 0 .. 2 loop
P := To_Ptr (F (B'Address, I)); P := To_Ptr (F (B'Address, I));
P.all := 0; P.all := 0;
end loop; end loop;
end ; end ;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-Os -g" } -- { dg-options "-Os -g" }
with Opt7_Pkg; with Opt7_Pkg;
package body Opt7 is package body Opt7 is
procedure Parse (Str : String; procedure Parse (Str : String;
Time_Type : out time_t; Time_Type : out time_t;
Abs_Time : out Time; Abs_Time : out Time;
Delt_Time : out Duration) is Delt_Time : out Duration) is
Year : Year_Number; Year : Year_Number;
Month : Month_Number; Month : Month_Number;
Day : Day_Number; Day : Day_Number;
Minute : Integer := 0; Minute : Integer := 0;
Idx : Integer := Str'First; Idx : Integer := Str'First;
Ch : Character := Str (Idx); Ch : Character := Str (Idx);
Current_Time : Time; Current_Time : Time;
begin begin
if Ch = '-' then if Ch = '-' then
Time_Type := Absolute_Time; Time_Type := Absolute_Time;
Current_Time := Clock; Current_Time := Clock;
Day := Ada.Calendar.Day (Current_Time); Day := Ada.Calendar.Day (Current_Time);
Month := Ada.Calendar.Month (Current_Time); Month := Ada.Calendar.Month (Current_Time);
Year := Ada.Calendar.Year (Current_Time); Year := Ada.Calendar.Year (Current_Time);
else else
Time_Type := Delta_Time; Time_Type := Delta_Time;
end if; end if;
while Ch in '0' .. '9' loop while Ch in '0' .. '9' loop
Minute := Minute + Character'Pos (Ch); Minute := Minute + Character'Pos (Ch);
Idx := Idx + 1; Idx := Idx + 1;
Ch := Str (Idx); Ch := Str (Idx);
end loop; end loop;
if Time_Type = Absolute_Time then if Time_Type = Absolute_Time then
Abs_Time := Time_Of (Year, Month, Day, Day_Duration (1)); Abs_Time := Time_Of (Year, Month, Day, Day_Duration (1));
else else
Delt_Time := Duration (Float (Minute)); Delt_Time := Duration (Float (Minute));
end if; end if;
exception exception
when others => Opt7_Pkg.My_Raise_Exception; when others => Opt7_Pkg.My_Raise_Exception;
end; end;
end Opt7; end Opt7;
with Ada.Calendar; use Ada.Calendar; with Ada.Calendar; use Ada.Calendar;
package Opt7 is package Opt7 is
type time_t is (Absolute_Time, Delta_Time); type time_t is (Absolute_Time, Delta_Time);
procedure Parse (Str : String; procedure Parse (Str : String;
Time_Type : out time_t; Time_Type : out time_t;
Abs_Time : out Time; Abs_Time : out Time;
Delt_Time : out Duration); Delt_Time : out Duration);
end Opt7; end Opt7;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-gnatws" } -- { dg-options "-gnatws" }
package body pointer_variable_bounds is package body pointer_variable_bounds is
function COMPONENT_DAT(BP : in BUNDLE_POINTER_TYPE; CP : in COMP_POINTER_TYPE) return HALF_INTEGER is function COMPONENT_DAT(BP : in BUNDLE_POINTER_TYPE; CP : in COMP_POINTER_TYPE) return HALF_INTEGER is
type CP_TYPE is access COMP_POINTER_TYPE; type CP_TYPE is access COMP_POINTER_TYPE;
type CD_TYPE is access HALF_INTEGER; type CD_TYPE is access HALF_INTEGER;
CD : CD_TYPE; CD : CD_TYPE;
begin begin
return CD.all; return CD.all;
end; end;
procedure BUNDLE_DAT(BP : in BUNDLE_POINTER_TYPE) is procedure BUNDLE_DAT(BP : in BUNDLE_POINTER_TYPE) is
N0 : C_POINTER_TYPE := COMPONENT_DAT(BP, 4); N0 : C_POINTER_TYPE := COMPONENT_DAT(BP, 4);
begin begin
null; null;
end; end;
procedure SEQUENCE_DAT(BP : in BUNDLE_POINTER_TYPE) is procedure SEQUENCE_DAT(BP : in BUNDLE_POINTER_TYPE) is
N0 : C_POINTER_TYPE := COMPONENT_DAT(BP, 4); N0 : C_POINTER_TYPE := COMPONENT_DAT(BP, 4);
begin begin
null; null;
end; end;
end pointer_variable_bounds; end pointer_variable_bounds;
with pointer_variable_bounds_q; use pointer_variable_bounds_q; with pointer_variable_bounds_q; use pointer_variable_bounds_q;
package pointer_variable_bounds is package pointer_variable_bounds is
type HALF_INTEGER is range -32768 .. 32767; type HALF_INTEGER is range -32768 .. 32767;
subtype HALF_NATURAL is HALF_INTEGER range 0 .. 32767; subtype HALF_NATURAL is HALF_INTEGER range 0 .. 32767;
MAX_COMPS : constant HALF_NATURAL := HALF_NATURAL(A_MAX_COMPS); MAX_COMPS : constant HALF_NATURAL := HALF_NATURAL(A_MAX_COMPS);
subtype COMP_POINTER_TYPE is HALF_NATURAL range 0 .. MAX_COMPS; subtype COMP_POINTER_TYPE is HALF_NATURAL range 0 .. MAX_COMPS;
subtype BUNDLE_POINTER_TYPE is HALF_NATURAL range 0 .. 1; subtype BUNDLE_POINTER_TYPE is HALF_NATURAL range 0 .. 1;
subtype C_POINTER_TYPE is HALF_NATURAL range 0 .. 1; subtype C_POINTER_TYPE is HALF_NATURAL range 0 .. 1;
procedure BUNDLE_DAT(BP : in BUNDLE_POINTER_TYPE); procedure BUNDLE_DAT(BP : in BUNDLE_POINTER_TYPE);
procedure SEQUENCE_DAT(BP : in BUNDLE_POINTER_TYPE); procedure SEQUENCE_DAT(BP : in BUNDLE_POINTER_TYPE);
end pointer_variable_bounds; end pointer_variable_bounds;
-- { dg-do compile } -- { dg-do compile }
package body Rep_Clause2 is package body Rep_Clause2 is
procedure Assign (From : Data; Offset : Positive; I : Index; To : out Bit_Array) is procedure Assign (From : Data; Offset : Positive; I : Index; To : out Bit_Array) is
begin begin
To (Offset .. Offset + 7) := Bit_Array (Conv (From.D(I).S.N)); To (Offset .. Offset + 7) := Bit_Array (Conv (From.D(I).S.N));
end; end;
end Rep_Clause2; end Rep_Clause2;
with Unchecked_Conversion; with Unchecked_Conversion;
package Rep_Clause2 is package Rep_Clause2 is
type Tiny is range 0 .. 3; type Tiny is range 0 .. 3;
for Tiny'Size use 2; for Tiny'Size use 2;
type Small is range 0 .. 255; type Small is range 0 .. 255;
for Small'Size use 8; for Small'Size use 8;
type Small_Data is record type Small_Data is record
D : Tiny; D : Tiny;
N : Small; N : Small;
end record; end record;
pragma Pack (Small_Data); pragma Pack (Small_Data);
type Chunk is type Chunk is
record record
S : Small_Data; S : Small_Data;
C : Character; C : Character;
end record; end record;
for Chunk use record for Chunk use record
S at 0 range 0 .. 15; S at 0 range 0 .. 15;
C at 2 range 0 .. 7; C at 2 range 0 .. 7;
end record; end record;
type Index is range 1 .. 10; type Index is range 1 .. 10;
type Data_Array is array (Index) of Chunk; type Data_Array is array (Index) of Chunk;
for Data_Array'Alignment use 2; for Data_Array'Alignment use 2;
pragma Pack (Data_Array); pragma Pack (Data_Array);
type Data is record type Data is record
D : Data_Array; D : Data_Array;
end record; end record;
type Bit is range 0 .. 1; type Bit is range 0 .. 1;
for Bit'Size use 1; for Bit'Size use 1;
type Bit_Array is array (Positive range <>) of Bit; type Bit_Array is array (Positive range <>) of Bit;
pragma Pack (Bit_Array); pragma Pack (Bit_Array);
type Byte is new Bit_Array (1 .. 8); type Byte is new Bit_Array (1 .. 8);
for Byte'Size use 8; for Byte'Size use 8;
for Byte'Alignment use 1; for Byte'Alignment use 1;
function Conv function Conv
is new Unchecked_Conversion(Source => Small, Target => Byte); is new Unchecked_Conversion(Source => Small, Target => Byte);
procedure Assign (From : Data; Offset : Positive; I : Index; To : out Bit_Array); procedure Assign (From : Data; Offset : Positive; I : Index; To : out Bit_Array);
end Rep_Clause2; end Rep_Clause2;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-O" } -- { dg-options "-O" }
package body Slice2 is package body Slice2 is
function F (I : R1) return R2 is function F (I : R1) return R2 is
Val : R2; Val : R2;
begin begin
Val.Text (1 .. 8) := I.Text (1 .. 8); Val.Text (1 .. 8) := I.Text (1 .. 8);
return Val; return Val;
end F; end F;
end Slice2; end Slice2;
package Slice2 is package Slice2 is
type R1 is record type R1 is record
Text : String (1 .. 30); Text : String (1 .. 30);
end record; end record;
type R2 is record type R2 is record
Text : String (1 .. 8); Text : String (1 .. 8);
B : Boolean := True; B : Boolean := True;
end record; end record;
function F (I : R1) return R2; function F (I : R1) return R2;
end Slice2; end Slice2;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-gnatws" } -- { dg-options "-gnatws" }
with Slice6_Pkg; use Slice6_Pkg; with Slice6_Pkg; use Slice6_Pkg;
procedure Slice6 is procedure Slice6 is
procedure Send (V_LENGTH : SHORT_INTEGER) is procedure Send (V_LENGTH : SHORT_INTEGER) is
V : Integer; V : Integer;
V_BLOCK : T_BLOCK (1 .. 4096); V_BLOCK : T_BLOCK (1 .. 4096);
for V_BLOCK use at V'Address; for V_BLOCK use at V'Address;
V_MSG : T_MSG ; V_MSG : T_MSG ;
begin begin
V_MSG := (V_LENGTH, 1, V_BLOCK (1 .. V_LENGTH)); V_MSG := (V_LENGTH, 1, V_BLOCK (1 .. V_LENGTH));
end; end;
begin begin
null; null;
end; end;
package Slice6_Pkg is package Slice6_Pkg is
subtype LENGTH_RANGE is SHORT_INTEGER range 0 .. 8184; subtype LENGTH_RANGE is SHORT_INTEGER range 0 .. 8184;
type T_BLOCK is array (SHORT_INTEGER range <>) of SHORT_SHORT_INTEGER; type T_BLOCK is array (SHORT_INTEGER range <>) of SHORT_SHORT_INTEGER;
for T_BLOCK'alignment use 4; for T_BLOCK'alignment use 4;
type T_MSG (V_LENGTH : LENGTH_RANGE := 0) is type T_MSG (V_LENGTH : LENGTH_RANGE := 0) is
record record
HEADER : Integer; HEADER : Integer;
DATAS : T_BLOCK (1 .. V_LENGTH) := (others => 0); DATAS : T_BLOCK (1 .. V_LENGTH) := (others => 0);
end record; end record;
for T_MSG'alignment use 4; for T_MSG'alignment use 4;
end Slice6_Pkg; end Slice6_Pkg;
-- { dg-do compile } -- { dg-do compile }
package Unchecked_Union2 is package Unchecked_Union2 is
type Small_Int is range 0 .. 2**19 - 1; type Small_Int is range 0 .. 2**19 - 1;
type R1 (B : Boolean := True) is record type R1 (B : Boolean := True) is record
case B is case B is
when True => Data1 : Small_Int; when True => Data1 : Small_Int;
when False => Data2 : Small_Int; when False => Data2 : Small_Int;
end case; end case;
end record; end record;
for R1 use record for R1 use record
Data1 at 0 range 0 .. 18; Data1 at 0 range 0 .. 18;
Data2 at 0 range 0 .. 18; Data2 at 0 range 0 .. 18;
end record; end record;
for R1'Size use 24; for R1'Size use 24;
pragma Unchecked_Union (R1); pragma Unchecked_Union (R1);
type R2 is record type R2 is record
Data : R1; Data : R1;
end record; end record;
for R2 use record for R2 use record
Data at 0 range 3 .. 26; Data at 0 range 3 .. 26;
end record; end record;
end Unchecked_Union2; end Unchecked_Union2;
-- { dg-do compile } -- { dg-do compile }
-- { dg-options "-g" } -- { dg-options "-g" }
with Taft_Type2_Pkg; use Taft_Type2_Pkg; with Taft_Type2_Pkg; use Taft_Type2_Pkg;
package body Taft_Type2 is package body Taft_Type2 is
procedure Proc is procedure Proc is
A : T; A : T;
function F return T is function F return T is
My_T : T; My_T : T;
begin begin
My_T := Open; My_T := Open;
return My_T; return My_T;
end; end;
begin begin
A := F; A := F;
end; end;
end Taft_Type2; end Taft_Type2;
package Taft_Type2 is package Taft_Type2 is
procedure Proc; procedure Proc;
end Taft_Type2; end Taft_Type2;
package Taft_Type2_Pkg is package Taft_Type2_Pkg is
type T is private; type T is private;
function Open return T; function Open return T;
private private
type Buffer_T; type Buffer_T;
type T is access Buffer_T; type T is access Buffer_T;
end Taft_Type2_Pkg; end Taft_Type2_Pkg;
-- { dg-do compile } -- { dg-do compile }
with Volatile10_Pkg; use Volatile10_Pkg; with Volatile10_Pkg; use Volatile10_Pkg;
procedure Volatile10 is procedure Volatile10 is
N : Num; N : Num;
begin begin
N := F.N1; N := F.N1;
N := F.N2; N := F.N2;
end; end;
package Volatile10_Pkg is package Volatile10_Pkg is
type Num is mod 2**9; type Num is mod 2**9;
type Rec is record type Rec is record
B1 : Boolean; B1 : Boolean;
N1 : Num; N1 : Num;
B2 : Boolean; B2 : Boolean;
N2 : Num; N2 : Num;
B3 : Boolean; B3 : Boolean;
B4 : Boolean; B4 : Boolean;
B5 : Boolean; B5 : Boolean;
B6 : Boolean; B6 : Boolean;
B7 : Boolean; B7 : Boolean;
B8 : Boolean; B8 : Boolean;
B9 : Boolean; B9 : Boolean;
B10 : Boolean; B10 : Boolean;
B11 : Boolean; B11 : Boolean;
B12 : Boolean; B12 : Boolean;
B13 : Boolean; B13 : Boolean;
B14 : Boolean; B14 : Boolean;
end record; end record;
pragma Pack (Rec); pragma Pack (Rec);
for Rec'Size use 32; for Rec'Size use 32;
pragma Volatile(Rec); pragma Volatile(Rec);
function F return Rec; function F return Rec;
end Volatile10_Pkg; end Volatile10_Pkg;
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