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