Add test cases
From-SVN: r127534
This commit is contained in:
parent
439cafcf60
commit
f0092c54c8
10
gcc/testsuite/gnat.dg/controlled2.adb
Normal file
10
gcc/testsuite/gnat.dg/controlled2.adb
Normal 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;
|
22
gcc/testsuite/gnat.dg/itypes.adb
Normal file
22
gcc/testsuite/gnat.dg/itypes.adb
Normal 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;
|
4
gcc/testsuite/gnat.dg/itypes.ads
Normal file
4
gcc/testsuite/gnat.dg/itypes.ads
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
package itypes is
|
||||
procedure Proc;
|
||||
end;
|
19
gcc/testsuite/gnat.dg/modify_a_constant.adb
Normal file
19
gcc/testsuite/gnat.dg/modify_a_constant.adb
Normal 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;
|
14
gcc/testsuite/gnat.dg/warn2.adb
Normal file
14
gcc/testsuite/gnat.dg/warn2.adb
Normal 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;
|
Loading…
Reference in New Issue
Block a user