Add test cases

From-SVN: r127534
This commit is contained in:
Arnaud Charlet 2007-08-16 10:18:31 +02:00
parent 439cafcf60
commit f0092c54c8
5 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,10 @@
-- { dg-do compile }
with controlled1; use controlled1;
package body controlled2 is
procedure Test_Suite is
begin
Add_Test
(new Test_Case'(Test_Case1 with Link_Under_Test => 300));
end Test_Suite;
end controlled2;

View File

@ -0,0 +1,22 @@
-- { dg-do compile }
package body itypes is
Size : constant := 10;
type Arr is array (1 .. size) of Integer;
type Rec is record
Field1 : Arr := (others => 0);
Field2 : Arr := (others => 0);
Field3 : Arr := (others => 0);
Field4 : Arr := (others => 0);
Field5 : Arr := (others => 0);
Field6 : Arr := (others => 0);
Field7 : Arr := (others => 0);
end record;
procedure Proc is
Temp1 : Rec;
begin
null;
end;
end;

View File

@ -0,0 +1,4 @@
package itypes is
procedure Proc;
end;

View File

@ -0,0 +1,19 @@
-- { dg-do compile }
with text_io; use text_io;
procedure modify_a_constant is
type Outer;
type Inner (Outer_Ref : access Outer) is limited null record;
type Outer is limited record
Inner_Field : Inner (Outer_Ref => Outer'Access);
Integer_Field : Integer;
end record;
X : constant Outer := (Inner_Field => <>, Integer_Field => 123);
begin
Put_Line (Integer'image (X.Integer_Field));
X.Inner_Field.Outer_Ref.Integer_Field := 0;
Put_Line (Integer'image (X.Integer_Field));
end Modify_A_Constant;

View File

@ -0,0 +1,14 @@
-- { dg-do compile }
with Unchecked_Conversion;
procedure warn2 is
type R1 is record X : Integer; end record;
type R2 is record X, Y : Integer; end record;
pragma Warnings
(Off, "types for unchecked conversion have different sizes");
function F is new Unchecked_Conversion (R1, R2);
pragma Warnings
(On, "types for unchecked conversion have different sizes");
begin
null;
end warn2;