file_text
stringlengths
1
2.1M
⌀
language
stringclasses
416 values
file_name
stringlengths
1
185
⌀
-- AD7006A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ad7006a.ada
-- AD7101A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ad7101a.ada
-- AD7101C.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ad7101c.ada
-- AD7102A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ad7102a.ada
-- AD7103A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ad7103a.ada
-- AD7103C.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ad7103c.ada
-- AD7104A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ad7104a.ada
-- AD7201A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ad7201a.ada
-- AD7203B.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ad7203b.ada
-- AD7205B.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ad7205b.ada
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ...
Ada
ada.ads
-- ADA101A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ada101a.ada
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
Ada
ada_get_targ.adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
Ada
adabkend.adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
Ada
adabkend.ads
-- { dg-do compile } with System; package body addr1 is task type T is entry Send (Location : System.Address); end; task body T is begin accept Send (Location : System.Address) do declare Buffer : String (1 .. 100); for Buffer'Address use Location; -- Test ...
Ada
addr1.adb
package addr1 is pragma Elaborate_Body; end;
Ada
addr1.ads
-- { dg-do compile } with System; procedure Addr10 is type Limited_Type is limited record Element : Integer; end record; function Initial_State return Limited_Type is ((Element => 0)); type Double_Limited_Type is record A : Limited_Type; end record; Double_Limited : Doubl...
Ada
addr10.adb
-- { dg-do run } procedure Addr11 is type Rec is record I : Short_Integer; C : Character; end record; type Derived is new Rec; for Derived use record I at 1 range 0 .. 15; C at 0 range 0 .. 7; end record; Init : constant Rec := ( 1515, 'A' ); D1 : Derived; D2 : Derived; pragma Vo...
Ada
addr11.adb
-- { dg-do run } with Addr12_A; procedure Addr12 is begin Addr12_A.Do_Stuff; end;
Ada
addr12.adb
with Addr12_B; with Addr12_C; with System; package body Addr12_A is First_Address : constant System.Address := Addr12_C.First'Address; Second_Address : constant System.Address := Addr12_C.Second'Address; First_Channel : Addr12_B.Shared_Context_Type := Addr12_B.Initial_State with Volatile, Async_Readers,...
Ada
addr12_a.adb
package Addr12_A is procedure Do_Stuff; end Addr12_A;
Ada
addr12_a.ads
package body Addr12_B is function Initial_State return Shared_Context_Type is begin return Shared_Context_Type'(Data => (others => Null_Entry)); end Initial_State; end Addr12_B;
Ada
addr12_b.adb
package Addr12_B is type Entry_Type is record Auto_Init : Boolean; end record; type Entry_Range is range 1 .. 20; type Entries_Type is array (Entry_Range) of Entry_Type; Null_Entry : constant Entry_Type := Entry_Type'(Auto_Init => False); type Shared_Context_Type is limited private; fun...
Ada
addr12_b.ads
with Addr12_B; package Addr12_C is First : Addr12_B.Shared_Context_Type; Second : Addr12_B.Shared_Context_Type; end Addr12_C;
Ada
addr12_c.ads
-- { dg-do compile } package body Addr13 is procedure Overlay is Over : Integer with Address => Gen_Obj'Address; begin Over := 123; end Overlay; end Addr13;
Ada
addr13.adb
generic Gen_Obj : in out Integer; package Addr13 is procedure Overlay; end Addr13;
Ada
addr13.ads
-- { dg-do run } with System; procedure Addr14 is type Arr is array (1 .. 4) of aliased Integer; A : Arr := (1, 2, 3, 4); I : Natural := 0; function Get_Address return System.Address is begin I := I + 1; return A(I)'Address; end; Foo : Integer with Address => Get_Address; begin if Foo /=...
Ada
addr14.adb
-- { dg-do run } with System; use System; procedure Addr15 is function Get_Bound (Param : Integer) return Integer is (Param); type Alpha_Typ is array (1 .. Get_Bound (1)) of Integer; type Beta_Typ is array (1 .. Get_Bound (0)) of Integer; Alpha : Alpha_Typ; Beta : aliased Beta_Typ; begin if Alpha'A...
Ada
addr15.adb
-- { dg-do compile } with Addr16_Pkg; use Addr16_Pkg; procedure Addr16 (R : Rec) is pragma Unsuppress (Alignment_Check); B : Integer; for B'Address use R.A'Address; begin null; end;
Ada
addr16.adb
package Addr16_Pkg is type Arr is array (Positive range <>) of Long_Long_Integer; type Rec (D : Positive) is record A : Arr (1 .. D); end record; end Addr16_Pkg;
Ada
addr16_pkg.ads
-- { dg-do run } with addr2_p; use addr2_p; procedure addr2 is begin Process (B1); Process (Blk => B1); Process (B2); Process (Blk => B2); end;
Ada
addr2.adb
with System; package body addr2_p is procedure Process (Blk : Block) is use type System.Address; begin if Blk'Address /= B1'Address and then Blk'Address /= B2'Address then raise Program_Error; end if; end; end;
Ada
addr2_p.adb
package addr2_p is type Block is array (1 .. 9) of Integer; procedure Process (Blk : Block); B1 : constant Block := Block'((1,2,3,4,5, others => 0)); B2 : constant Block := (1,2,3,4,5, others => 0); end;
Ada
addr2_p.ads
-- { dg-do compile } with text_io; with System; procedure addr3 is Type T_SAME_TYPE is new System.Address; Type T_OTHER_TYPE is new System.Address; I : constant integer := 0; ...
Ada
addr3.adb
-- { dg-do compile } -- { dg-options "-g" } procedure Addr4 is function F return String is begin return ""; end F; S1 : String renames F; subtype ST is String (1 .. S1'Length); S2 : ST; for S2'Address use S1'Address; begin null; end;
Ada
addr4.adb
-- { dg-do compile } -- { dg-options "-g" } procedure Addr5 (Len : Integer) is S : aliased String (1 .. Len) := (others => ' '); C : Character; for C'Address use S'Address; begin null; end;
Ada
addr5.adb
-- { dg-do compile } procedure Addr6 is type Byte is mod 2**8; type Byte_Arr1 is array (Positive range <>) of Byte; for Byte_Arr1'Alignment use 4; type Byte_Arr2 is array (Positive range <>) of Byte; function Length return Natural is begin return 1; end; function Empty return Byte_Arr...
Ada
addr6.adb
-- { dg-do compile } package body Addr7 is procedure Proc (B: aliased Bytes) is O: Integer; for O'Address use B'Address; begin null; end; end Addr7;
Ada
addr7.adb
package Addr7 is type Bytes is array (1 .. 4) of Character; for Bytes'Alignment use 4; procedure Proc (B: aliased Bytes); end Addr7;
Ada
addr7.ads
-- { dg-do compile } package body Addr8 is procedure Proc (B: Bytes) is O: Integer; for O'Address use B'Address; begin null; end; end Addr8;
Ada
addr8.adb
package Addr8 is type Bytes is array (1 .. 4) of Character; for Bytes'Alignment use 4; procedure Proc (B: Bytes); end Addr8;
Ada
addr8.ads
-- { dg-do compile } with Ada.Streams; use Ada.Streams; procedure Addr9_1 is type Signal_Type is mod 2 ** 16; type A_Item is record I : Signal_Type; Q : Signal_Type; end record with Size => 32; for A_Item use record I at 0 range 0 .. 15; Q at 2 range 0 .. 15; ...
Ada
addr9_1.adb
-- { dg-do compile } with Ada.Streams; use Ada.Streams; procedure Addr9_2 is type Signal_Type is mod 2 ** 16; type A_Item is record I : Signal_Type; Q : Signal_Type; end record with Size => 32; for A_Item use record I at 0 range 0 .. 15; Q at 2 range 0 .. 15; ...
Ada
addr9_2.adb
-- { dg-do compile } with Ada.Streams; use Ada.Streams; procedure Addr9_3 is type Signal_Type is mod 2 ** 16; type A_Item is record I : Signal_Type; Q : Signal_Type; end record with Size => 32; for A_Item use record I at 0 range 0 .. 15; Q at 2 range 0 .. 15; ...
Ada
addr9_3.adb
-- { dg-do compile } with Ada.Streams; use Ada.Streams; procedure Addr9_4 is type Signal_Type is mod 2 ** 16; type A_Item is record I : Signal_Type; Q : Signal_Type; end record with Size => 32; for A_Item use record I at 0 range 0 .. 15; Q at 2 range 0 .. 15; ...
Ada
addr9_4.adb
-- { dg-do compile } -- { dg-options "-gnatws" } procedure Addr_Slice is type Item_Type is record I : Integer; end record; type Index_Type is (A, B); for Index_Type use (A => 1, B => 10); Item_Array : constant array (Index_Type) of Item_Type := (A => (I => 10), B => (I => 22)); Item :...
Ada
addr_slice.adb
-- { dg-do compile } with System.Storage_Elements; use System.Storage_Elements; procedure Address_Conv is subtype My_Address is System.Address; type Rec is record A : My_Address; end record; Addr : constant My_Address := To_Address (16#FACEFACE#); R : constant Rec := (A => Addr); begin null; end...
Ada
address_conv.adb
-- { dg-do run } -- { dg-options "-O2" } with System.Address_To_Access_Conversions; procedure address_conversion is type Integer_type1 is new Integer; type Integer_type2 is new Integer; package AA is new System.Address_To_Access_Conversions (Integer_type1); K1 : Integer_type1; K2 : Integer_type2; b...
Ada
address_conversion.adb
package Address_Null_Init is type Acc is access Integer; A : Acc := new Integer'(123); B : Acc; -- Variable must be set to null (and A overwritten by null) for B'Address use A'Address; end Address_Null_Init;
Ada
address_null_init.ads
-- AE2113A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ae2113a.ada
-- AE2113B.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ae2113b.ada
-- AE3002G.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ae3002g.ada
-- AE3101A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ae3101a.ada
-- AE3702A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ae3702a.ada
-- AE3709A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
Ada
ae3709a.ada
-- { dg-do run } procedure aggr1 is package Coord is type T is private; private type T is record A, B, C : Float; end record; end Coord; -- generic type T is private; package gen is type Rec (Discr : Boolean := True) is record needs_update : Boolean; ...
Ada
aggr1.adb
-- { dg-do compile } package aggr1 is type Buffer_Array is array (1 .. 2 ** 23) of Integer; type Message is record Data : Buffer_Array := (others => 0); end record; end;
Ada
aggr1.ads
-- { dg-do compile } -- { dg-options "-O2" } with Aggr10_Pkg; use Aggr10_Pkg; procedure Aggr10 is No_Name_Location : constant Name_Location := (Name => Name_Id'First, Location => Int'First, Source => Source_Id'First, ...
Ada
aggr10.adb
package Aggr10_Pkg is type Name_Id is range 300_000_000 .. 399_999_999; type Int is range -2 ** 31 .. +2 ** 31 - 1; type Source_Id is range 5_000_000 .. 5_999_999; type Name_Location is record Name : Name_Id; Location : Int; Source : Source_Id; Except : Boolean; Found...
Ada
aggr10_pkg.ads
-- { 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 ...
Ada
aggr11.adb
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;
Ada
aggr11_pkg.ads
-- { dg-do compile } -- { dg-options "-fdump-tree-original" } package body Aggr12 is procedure Print (Data : String) is begin null; end; procedure Test is begin Print (Hair_Color_Type'Image (A.I1)); Print (Hair_Color_Type'Image (A.I2)); end; end Aggr12; -- { dg-final { scan-tree-dump-not "{...
Ada
aggr12.adb
package Aggr12 is type Hair_Color_Type is (Black, Brown, Blonde, Grey, White, Red); type Rec is record I1, I2 : Hair_Color_Type; end record; A : constant Rec := (Black, Blonde); procedure Print (Data : String); procedure Test; end Aggr12;
Ada
aggr12.ads
-- { dg-do compile } -- { dg-options "-fdump-tree-gimple" } procedure Aggr13 is type A is array (Integer range 1 .. 3) of Short_Short_Integer; X : A := (1, 2, 3); function F return A is begin if X /= (1, 2, 3) then raise Program_Error; end if; return (1, 1, 1); end; begin ...
Ada
aggr13.adb
-- { dg-do run } with Aggr14_Pkg; use Aggr14_Pkg; procedure Aggr14 is begin Proc; end;
Ada
aggr14.adb
package body Aggr14_Pkg is function F return A is begin if X /= (1, 2, 3) then raise Program_Error; end if; return (1, 1, 1); end; procedure Proc is begin X := F; end; end Aggr14_Pkg;
Ada
aggr14_pkg.adb
package Aggr14_Pkg is type A is array (Integer range 1 .. 3) of Short_Short_Integer; X : A := (1, 2, 3); procedure Proc; end Aggr14_Pkg;
Ada
aggr14_pkg.ads
-- { 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;
Ada
aggr15.adb
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;
Ada
aggr15.ads
-- { dg-do compile } with Aggr16_Pkg; use Aggr16_Pkg; package body Aggr16 is type Arr is array (1 .. 4) of Time; type Change_Type is (One, Two, Three); type Change (D : Change_Type) is record case D is when Three => A : Arr; when Others => B : Boolean; end case; end reco...
Ada
aggr16.adb
package Aggr16 is procedure Proc; end Aggr16;
Ada
aggr16.ads
package Aggr16_Pkg is type Time_Type is (A, B); type Time (D : Time_Type := A) is private; Null_Time : constant Time; private type Hour is record I1 : Integer; I2 : Integer; end record; type Time (D : Time_Type := A) is record case D is when A => A_Time : Integer; when ...
Ada
aggr16_pkg.ads
-- { 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 :...
Ada
aggr17.adb
-- { 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 :...
Ada
aggr18.adb
-- { dg-do run } with Aggr19_Pkg; use Aggr19_Pkg; procedure Aggr19 is C : Rec5 := (Ent => (Kind => Two, Node => (L => (D => True, Pos => 1 )), I => 0)); A : Rec5 := C; begin Proc (A); if A /= C then raise Program_Error; end if; end;
Ada
aggr19.adb
package body Aggr19_Pkg is procedure Proc (Pool : in out Rec5) is begin Pool.Ent := (Kind => Two, Node => Pool.Ent.Node, I => 0); end; end ;
Ada
aggr19_pkg.adb
package Aggr19_Pkg is type Rec1 (D : Boolean := False) is record case D is when False => null; when True => Pos : Integer; end case; end record; type Rec2 is record L : Rec1; end record; type Rec3 is tagged null record; type Enum is (One, Two, Three); type Rec4 (Kind : Enum :=...
Ada
aggr19_pkg.ads
-- { dg-do compile } procedure aggr2 is task type T_Task; -- task body T_Task is begin null; end; -- type Lim_Rec is record T : T_Task; end record; -- generic Formal : Lim_Rec; package P_G is end P_G; -- package P is new P_G (Formal => (T => <>)); begin null; end;
Ada
aggr2.adb
-- { dg-do compile } package Aggr2 is type Buffer is array (Positive range <>) of Boolean; for Buffer'Alignment use 4; type Buffer_Ptr is access Buffer; subtype My_Buffer is Buffer (1 .. 2); P : Buffer_Ptr := new My_Buffer'(Others => False); end Aggr2;
Ada
aggr2.ads
-- { dg-do compile } package body Aggr20 is procedure Proc (R : out Rec3) is begin R := (Callback => Nil_Rec2); end; end Aggr20;
Ada
aggr20.adb
with Aggr20_Pkg; use Aggr20_Pkg; with System; package Aggr20 is type Rec1 is record Address : System.Address; end record; Nil_Rec1 : constant Rec1 := (Address => Default_Nil_Address); type Rec2 is record Callback : Rec1; end record; Nil_Rec2 : constant Rec2 := (Callback => Nil_Rec1); ...
Ada
aggr20.ads
with System; package Aggr20_Pkg is procedure Proc; Default_Nil_Address : constant System.Address := Proc'Address; end Aggr20_Pkg;
Ada
aggr20_pkg.ads
-- { dg-do run } with Aggr21_Pkg; use Aggr21_Pkg; procedure Aggr21 is V : Rec; begin V.A := 12; V.S (1 .. 10) := "Hello init"; V.N := 123; Init (V); -- Probably not reliable, but the compiler is supposed not to modify V.S pragma Assert (V.s (1 .. 5) = "Hello"); end;
Ada
aggr21.adb
package body Aggr21_Pkg is procedure Init (R : out Rec) is begin R := (A => 5, S => <>, N => 7); end; end Aggr21_Pkg;
Ada
aggr21_pkg.adb
package Aggr21_Pkg is type Rec is record A : Integer; S : String (1 .. 120); N : Natural; end record; procedure Init (R : out Rec); end Aggr21_Pkg;
Ada
aggr21_pkg.ads
-- { dg-do compile } package body Aggr22 is type Ptr is access all Integer; type Arr is array (Positive range <>) of Ptr; procedure Proc is A : Arr (1 .. 33); begin A := (1 => null, 2 .. 32 => My_Rec.I'Access, 33 => null); end; end Aggr22;
Ada
aggr22.adb
with System; package Aggr22 is type Rec is record C : Character; I : aliased Integer; end record; My_Rec : aliased Rec; pragma Import (Ada, My_Rec); for My_Rec'Address use System'To_Address (16#40086000#); procedure Proc; end Aggr22;
Ada
aggr22.ads
-- { dg-options "-gnatws" } -- { dg-do run } with Aggr23_Q; procedure Aggr23 is begin Aggr23_Q (2); end;
Ada
aggr23.adb
-- { dg-options "-gnatws" } with Ada.Text_IO; use Ada.Text_IO; with Aggr23_TT; use Aggr23_TT; procedure Aggr23_Q (Count : Natural) is Ts : array (1 .. Count) of TA := (others => new T (new Integer)); -- Test begin if Ts (1).D = Ts (2).D then Put ("ERROR"); end if; end;
Ada
aggr23_q.adb
package Aggr23_TT is type T (D : not null access Integer) is null record; type TA is access T; end;
Ada
aggr23_tt.ads
-- { dg-do run } with Aggr24_Pkg; use Aggr24_Pkg; procedure Aggr24 is V : Rec; begin V.S := "Hello"; Init (V); if V.S /= "Hello" then raise Program_Error; end if; end;
Ada
aggr24.adb
package body Aggr24_Pkg is procedure Init (R : out Rec) is begin R := (I1 => 0, I2 => 0, I3 => 0, I4 => 0, I5 => 0, I6 => 0, I7 => 0, S => <>); end; end Aggr24_Pkg;
Ada
aggr24_pkg.adb
package Aggr24_Pkg is type Rec is record I1 : Integer; I2 : Integer; I3 : Integer; I4 : Integer; I5 : Integer; I6 : Integer; I7 : Integer; S : String (1 .. 5); end record; procedure Init (R : out Rec); end Aggr24_Pkg;
Ada
aggr24_pkg.ads
-- { dg-do compile } package body Aggr25 is procedure Foo is null; end Aggr25;
Ada
aggr25.adb
package Aggr25 is type T_A is (A, B , C ,D); subtype Has_B_D is T_A with Static_Predicate => Has_B_D in B | D; type Obj_T (Kind : T_A) is record case Kind is --OK-- when A | C => null; --OK-- when Has_B_D => Value : Boolean; --BAD-- when A | C => null; when others =...
Ada
aggr25.ads
-- { dg-do compile } procedure Aggr26 is type Row is array (Positive) of Integer; H : array (Positive) of Row := (others => (others => 0)); -- { dg-warning "Storage_Error will be raised at run time" } begin null; end Aggr26;
Ada
aggr26.adb
-- { dg-do run } -- { dg-options "-gnatws -gnata" } with GNAT.Random_Numbers; procedure Aggr27 is Gen: GNAT.Random_Numbers.Generator; function Random return Long_Long_Integer is Rand : Integer := GNAT.Random_Numbers.Random(Gen); begin return Long_Long_Integer(Rand); end Random; type Va...
Ada
aggr27.adb
-- { dg-do run } procedure Aggr28 is Count : Natural := 0; function Get (S: String) return String is begin Count := Count + 1; return S; end; Max_Error_Length : constant := 8; subtype Error_Type is String (1 .. Max_Error_Length); type Rec is record Text : Error_Type; end record; typ...
Ada
aggr28.adb
-- { dg-do compile } -- { dg-options "-fdump-tree-gimple" } with Ada.Streams; use Ada.Streams; procedure Aggr29 is A : aliased Stream_Element_Array := (1 .. 512 => <>); begin null; end; -- { dg-final { scan-tree-dump-not "a___UNC = \\*" "gimple" } }
Ada
aggr29.adb