file_text
stringlengths
1
2.1M
⌀
language
stringclasses
416 values
file_name
stringlengths
1
185
⌀
package debug1 is type Vector is array (Natural range <>) of Natural; type Vector_Access is access Vector; type Data_Line is record Length : Vector (1 .. 1); Line : Vector_Access; end record; type Data_Block is array (1 .. 5) of Data_Line; type Data_Block_Access is access Data_Block...
Ada
debug1_1.ads
-- { dg-do compile } -- { dg-options "-g" } with Debug2_Pkg; use Debug2_Pkg; package body Debug2 is procedure Proc is function F return String_List_Ptr is begin return new String_List'(Singleton); end; A : String_List_Ptr := F; begin null; end; ...
Ada
debug2.adb
package Debug2 is procedure Proc; end Debug2;
Ada
debug2.ads
package Debug2_Pkg is type String_Ptr is access all String; function To_Heap return String_Ptr; type String_List(Chars_Length: Positive) is private; type String_List_Ptr is access constant String_List; function Singleton return String_List; private type String_List(Chars_Length: Positive)...
Ada
debug2_pkg.ads
-- { dg-do compile } -- { dg-options "-g" } with Ada.Unchecked_Conversion; with System; package body Debug3 is type Rec is record I : Integer; end record; for Rec'Alignment use 1; type Ptr is access Rec; function To_Ptr is new Ada.Unchecked_Conversion(System.Address, Ptr); procedure Proc is ...
Ada
debug3.adb
package Debug3 is procedure Proc; end Debug3;
Ada
debug3.ads
-- { dg-compile } -- { dg-options "-g" } with Debug4_Pkg; procedure Debug4 is package P is new Debug4_Pkg (Natural); begin null; end;
Ada
debug4.adb
package body Debug4_Pkg is type Vertex_To_Vertex_T is array (Vertex_Id range <>) of Vertex_Id; function Dominator_Tree_Internal (G : T'Class) return Vertex_To_Vertex_T is subtype V_To_V is Vertex_To_Vertex_T (0 .. G.Vertices.Last_Index); type V_To_VIL is array (Valid_Vertex_Id range 1 .. G.V...
Ada
debug4_pkg.adb
with Ada.Containers.Vectors; generic type Vertex_Key is private; package Debug4_Pkg is type Vertex_Id is new Natural; subtype Valid_Vertex_Id is Vertex_Id range 1 .. Vertex_Id'Last; package VIL is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Valid_Vertex_Id); use VI...
Ada
debug4_pkg.ads
-- { dg-do compile } -- { dg-options "-g" } procedure Debug5 is type Record_Type (L1, L2 : Natural) is record S1 : String (1 .. L1); case L2 is when 0 => null; when others => S2 : String (L1 .. L2); end case; end record; procedure Discard (R : Record_Type) is begi...
Ada
debug5.adb
-- { dg-do compile } -- { dg-options "-g" } with Debug6_Pkg; use Debug6_Pkg; procedure Debug6 is V : Value := (Kind => Undefined); begin Process (V); end Debug6;
Ada
debug6.adb
package Debug6_Pkg is type Vkind is (Int, Undefined); for Vkind use (Int => -2 ** 31, Undefined => 0); type Value (Kind : Vkind) is record case Kind is when Undefined => null; when Int => Value : Integer; when others => null; end case; end record; ...
Ada
debug6_pkg.ads
-- { dg-do compile } -- { dg-skip-if "No dwarf-2 support" { hppa*-*-hpux* } } -- { dg-options "-cargs -gdwarf-2 -gstrict-dwarf -dA -margs" } -- { dg-final { scan-assembler "DW_TAG_imported_decl" } } package body Debug7 is function Next (I : Integer) return Integer is begin return I + 1; end Next; end De...
Ada
debug7.adb
package Debug7 is function Next (I : Integer) return Integer; function Renamed_Next (I : Integer) return Integer renames Next; end Debug7;
Ada
debug7.ads
-- { dg-do compile } -- { dg-skip-if "No Dwarf" { { hppa*-*-hpux* } && { ! lp64 } } } -- { dg-options "-cargs -O0 -g -dA -fgnat-encodings=minimal -margs" } -- The DW_AT_byte_size attribute DWARF expression for the -- DW_TAG_structure_type DIE that describes Rec_Type contains the -4u literal. -- Check that it is not...
Ada
debug8.adb
-- The aim of this test is to check that Ada types appear in the proper -- context in the debug info. -- -- Checking this directly would be really tedious just scanning for assembly -- lines, so instead we rely on DWARFv4's .debug_types sections, which must be -- created only for global-scope types. Checking the n...
Ada
debug9.adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
Ada
debug_a.adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
Ada
debug_a.ads
package DECL_CTX_Def is X : exception; end;
Ada
decl_ctx_def.ads
-- { dg-do compile } -- { dg-options "-O1" } with DECL_CTX_Def; use DECL_CTX_Def; package body DECL_CTX_Use is procedure Check_1 is begin raise X; end; procedure Check_2 is begin raise X; end; end;
Ada
decl_ctx_use.adb
package DECL_CTX_Use is procedure Check_1; procedure Check_2; end;
Ada
decl_ctx_use.ads
-- { dg-do run } -- { dg-options "-gnata" } with Default_Initial_Condition_Pack; use Default_Initial_Condition_Pack; procedure Default_Initial_Condition is Obj : T; begin if not DIC_Called then raise Program_Error; end if; end Default_Initial_Condition;
Ada
default_initial_condition.adb
package body Default_Initial_Condition_Pack is function Is_OK (Val : T) return Boolean is begin DIC_Called := True; return True; end Is_OK; end Default_Initial_Condition_Pack;
Ada
default_initial_condition_pack.adb
package Default_Initial_Condition_Pack is type T; type T is private with Default_Initial_Condition => Is_OK (T); function Is_OK (Val : T) return Boolean; DIC_Called : Boolean := False; private type T is null record; end Default_Initial_Condition_Pack;
Ada
default_initial_condition_pack.ads
-- { dg-do compile } procedure Default_Pkg_Actual is generic package As is end As; generic type T is private; with package A0 is new As; package Bs is end Bs; generic with package Xa is new As; package Xs is package Xb is new Bs(T => Integer, A0 => Xa); end Xs; ...
Ada
default_pkg_actual.adb
-- { dg-do compile } procedure Default_Pkg_Actual2 is generic package P1 is end; generic with package FP1a is new P1; with package FP1b is new P1; package P2 is end; generic with package FP2 is new P2 (FP1a => <>, FP1b => <>); package P3 is end; package NP1a is new...
Ada
default_pkg_actual2.adb
-- { dg-do compile } procedure Default_Variants is type Variant_Kind is (A, B); function Get_Default_Value (Kind : in Variant_Kind) return Natural is (10); type Variant_Type (Kind : Variant_Kind := A) is record Common : Natural := Get_Default_Value (Kind); case Kind is ...
Ada
default_variants.adb
-- { dg-do compile } with Text_IO; use Text_IO; procedure Deferred_Const1 is I : Integer := 16#20_3A_2D_28#; S : constant string(1..4); for S'address use I'address; -- { dg-warning "constant overlays a variable" } pragma Import (Ada, S); begin Put_Line (S); end;
Ada
deferred_const1.adb
-- { dg-do run } with System; use System; with Deferred_Const2_Pkg; use Deferred_Const2_Pkg; procedure Deferred_Const2 is begin if I'Address /= S'Address then raise Program_Error; end if; end;
Ada
deferred_const2.adb
with System; use System; package body Deferred_Const2_Pkg is procedure Dummy is begin null; end; begin if S'Address /= I'Address then raise Program_Error; end if; end Deferred_Const2_Pkg;
Ada
deferred_const2_pkg.adb
package Deferred_Const2_Pkg is I : Integer := 16#20_3A_2D_28#; pragma Warnings (Off); S : constant string(1..4); for S'address use I'address; pragma Import (Ada, S); procedure Dummy; end Deferred_Const2_Pkg;
Ada
deferred_const2_pkg.ads
-- { dg-do run } with System; use System; with Deferred_Const3_Pkg; use Deferred_Const3_Pkg; procedure Deferred_Const3 is begin if C1'Address /= C'Address then raise Program_Error; end if; if C2'Address /= C'Address then raise Program_Error; end if; if C3'Address /= C'Address then raise Progra...
Ada
deferred_const3.adb
with System; use System; package body Deferred_Const3_Pkg is procedure Dummy is begin null; end; begin if C1'Address /= C'Address then raise Program_Error; end if; if C2'Address /= C'Address then raise Program_Error; end if; if C3'Address /= C'Address then raise Program_Error; end if; end...
Ada
deferred_const3_pkg.adb
package Deferred_Const3_Pkg is C : constant Natural := 1; C1 : constant Natural := 1; for C1'Address use C'Address; C2 : constant Natural; for C2'Address use C'Address; C3 : constant Natural; procedure Dummy; private C2 : constant Natural := 1; C3 : constant Natural := 1; for C3'Address use C...
Ada
deferred_const3_pkg.ads
-- { dg-do compile } package body Deferred_Const4 is function F return My_Q.T is R : My_Q.T; begin R := My_Q.Null_T; return R; end; end Deferred_Const4;
Ada
deferred_const4.adb
with Deferred_Const4_Pkg; package Deferred_Const4 is type R1 is tagged record I1 : Integer; end record; type R2 is new R1 with record I2 : Integer; end record; package My_Q is new Deferred_Const4_Pkg (R2); function F return My_Q.T; end Deferred_Const4;
Ada
deferred_const4.ads
generic type User_T is private; package Deferred_Const4_Pkg is type T is private; Null_T : constant T; private type T (Valid : Boolean := False) is record case Valid is when True => Value : User_T; when False => null; end case; end record; Null_T : constant T := (Valid => False);...
Ada
deferred_const4_pkg.ads
-- Copyright 2007-2023 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- ...
Ada
defs.adb
-- Copyright 2007-2023 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- ...
Ada
defs.ads
-- { dg-do compile } -- { dg-options "-gnat2020" } procedure Delta_Aggr is type T1 is tagged record F1, F2, F3 : Integer := 0; end record; function Make (X : Integer) return T1 is begin return (10, 20, 30); end Make; package Pkg is type T2 is new T1 with private; X, Y : c...
Ada
delta_aggr.adb
-- { dg-do compile } -- { dg-options "-gnatws" } package Delta_Small is type T is delta 0.1 range -0.8 .. 0.8; for T'Small use 0.1; for T'Size use 4; type T2 is new T range -0.4 .. 0.4; for T2'Small use 0.0625; end Delta_Small;
Ada
delta_small.ads
package Deques is type Deque (<>) is tagged limited private; function Create return Deque; procedure Pop (D : access Deque); type Sequence is limited interface; type P_Deque is new Deque and Sequence with private; function Create return P_Deque; private type Deque is tagged limited null r...
Ada
deques.ads
package deref1 is type T is tagged limited null record; procedure Op (Obj : in out T); end deref1;
Ada
deref1.ads
with deref1; package deref2 is type NT is tagged limited private; function PT_View (Obj : not null access NT) return not null access deref1.T'Class; private type PT (Obj : not null access NT) is new deref1.T with null record; type NT is tagged limited record PT_View : aliased PT (NT'Acces...
Ada
deref2.ads
-- { dg-do compile } with deref2; procedure deref3 is Obj : aliased deref2.NT; begin deref2.PT_View (Obj'Access).Op; Obj.PT_View.all.Op; Obj.PT_View.Op; end;
Ada
deref3.adb
-- { dg-do run } -- { dg-options "-O2" } procedure Derived_Aggregate is type Int is range 1 .. 10; type Str is array (Int range <>) of Character; type Parent (D1, D2 : Int; B : Boolean) is record S : Str (D1 .. D2); case B is when False => C1 : Integer; when True => C2 : Float; ...
Ada
derived_aggregate.adb
-- { dg-do compile } -- { dg-options "-gnatws -fdump-tree-original" } procedure Derived_Type1 is type Root is tagged null record; type Derived1 is new Root with record I1 : Integer; end record; type Derived2 is new Derived1 with record I2: Integer; end record; R : Root; D1 : Derived1; D2 : ...
Ada
derived_type1.adb
-- { dg-do run } -- { dg-options "-gnatws" } procedure Derived_Type2 is package Pkg is type Parent (B : Boolean := True) is record case B is when True => S : String (1 .. 5); when False => F : Float; end case; end record; function Create (X : Parent) re...
Ada
derived_type2.adb
-- { dg-do run } with Derived_Type3_Pkg; use Derived_Type3_Pkg; procedure Derived_Type3 is begin Proc1; Proc2; end;
Ada
derived_type3.adb
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; package body Derived_Type3_Pkg is type Parent is tagged null record; type Child is new Parent with record Image : Ada.Strings.Unbounded.Unbounded_String; end record; function Set_Image return Chil...
Ada
derived_type3_pkg.adb
package Derived_Type3_Pkg is procedure Proc1; procedure Proc2; end Derived_Type3_Pkg;
Ada
derived_type3_pkg.ads
-- { dg-do compile } procedure Derived_Type4 is type Root (D : Positive) is record S : String (1 .. D); end record; subtype Short is Positive range 1 .. 10; type Derived (N : Short := 1) is new Root (D => N); Obj : Derived; begin Obj := (N => 5, S => "Hello"); end;
Ada
derived_type4.adb
-- { dg-do compile } with Derived_Type5_Pkg; use Derived_Type5_Pkg; procedure Derived_Type5 is D : Derived; begin Proc1 (Rec (D)); Proc2 (Rec (D)); end;
Ada
derived_type5.adb
package Derived_Type5_Pkg is type T_Unsigned8 is new Natural range 0 .. (2 ** 8 - 1); type Rec (Discriminant : T_Unsigned8) is record Fixed_Field : T_Unsigned8; case Discriminant is when 0 => Optional_Field : T_unsigned8; when others => null; end case...
Ada
derived_type5_pkg.ads
-- { dg-do compile } package body Derived_Type6 is procedure Foo is null; end Derived_Type6;
Ada
derived_type6.adb
with Ada.Strings.Bounded; package Derived_Type6 is package b is new Ada.Strings.Bounded.Generic_Bounded_Length(10); subtype s1 is b.Bounded_String; type s2 is new s1; procedure Foo; end Derived_Type6;
Ada
derived_type6.ads
package body Derived_Type7 is procedure Proc (Size : Natural) is type Sar_Six_Bit_Arr is new Six_Bit_Data_Array_Type (1 .. Size); begin null; end; end Derived_Type7;
Ada
derived_type7.adb
-- { dg-do compile } package Derived_Type7 is type Six_Bit_Data_Type is range 0 .. 63; for Six_Bit_Data_Type'Size use 6; type Six_Bit_Data_Array_Type is array (Integer range <>) of Six_Bit_Data_Type; for Six_Bit_Data_Array_Type'Component_Size use 6; procedure Proc (Size : Natural); end Derived_Type7;
Ada
derived_type7.ads
-- { dg-do compile } with Dflt_Init_Cond_Pkg; use Dflt_Init_Cond_Pkg; procedure Dflt_Init_Cond is E : Explicit; I : Implicit; begin Read (E); Read (I); end Dflt_Init_Cond;
Ada
dflt_init_cond.adb
package Dflt_Init_Cond_Pkg is type Explicit is limited private with Default_Initial_Condition => True; type Implicit is limited private with Default_Initial_Condition; procedure Read (Obj : Explicit); procedure Read (Obj : Implicit); private type Implicit is access all Integer; type Explicit is acce...
Ada
dflt_init_cond_pkg.ads
-- { dg-do compile } package body Dimensions is procedure Dummy is null; end Dimensions;
Ada
dimensions.adb
package Dimensions is type Mks_Int_Type is new Integer with Dimension_System => ( (Unit_Name => Meter, Unit_Symbol => 'm', Dim_Symbol => 'L'), (Unit_Name => Kilogram, Unit_Symbol => "kg", Dim_Symbol => 'M'), (Unit_Name => Second, Unit_Symbol => 's', Dim_Symbol => 'T'), ...
Ada
dimensions.ads
-- { dg-do compile } with Dimensions2_phys; use Dimensions2_phys; procedure Dimensions2 is zero_flow : constant Volumetric_Flow := 0.0 * m**3 / h; type Node_Flow_Scenario_T is array (Positive range <>) of Volumetric_Flow with default_component_value => zero_flow; subtype Max_Node_Flow...
Ada
dimensions2.adb
with ada.numerics.generic_elementary_functions; with Dimensions2_real_numbers; package Dimensions2_Phys is type si_type is new Dimensions2_real_numbers.Real with dimension_system => ((unit_name => meter, unit_symbol => 'm', dim_symbol => 'L'), (unit_name => kilogram, unit_symbol => "kg", dim_sym...
Ada
dimensions2_phys.ads
package Dimensions2_Real_Numbers is type Real is new Long_Float; end;
Ada
dimensions2_real_numbers.ads
-- { dg-do compile { target *-*-gnu* } } -- { dg-options "-gnateS -gdwarf -g -O -gno-column-info" } -- { dg-final { scan-assembler "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 1\[ \n]" } } */ -- { dg-final { scan-assembler-not "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 2\[ \n]" } } */ -- { dg-final { ...
Ada
dinst.adb
with Ada.Text_IO; use Ada.Text_IO; package body DInst_Pkg is procedure Foo is begin Put_Line ("hello there"); end; end;
Ada
dinst_pkg.adb
generic package DInst_Pkg is procedure Foo; end;
Ada
dinst_pkg.ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ...
Ada
directio.ads
package discr1 is type R is (One, Two); type C_Type (Kind : R) is record case Kind is when One => Name : Integer; when Two => Designator : String (1 .. 40); end case; end record; for C_Type use record Name at 0 range 0.. 31; Designator at 0 ra...
Ada
discr1.ads
package body Discr10 is function Get (X : R) return R is begin return R'(D1 => False, D2 => False, D3 => X.D3); end; end Discr10;
Ada
discr10.adb
package Discr10 is subtype Index is Natural range 0 .. 150; type List is array (Index range <>) of Integer; type R (D1 : Boolean := True; D2 : Boolean := False; D3 : Index := 0) is record case D2 is when True => L : List (1 .. D3); case D1 is when Tru...
Ada
discr10.ads
-- { dg-do compile } package body Discr11 is function Create return DT_2 is begin return DT_2'(DT_1'(Create) with More => 1234); end; end Discr11;
Ada
discr11.adb
with Discr11_Pkg; use Discr11_Pkg; package Discr11 is type DT_2 is new DT_1 with record More : Integer; end record; function Create return DT_2; end Discr11;
Ada
discr11.ads
package Discr11_Pkg is type DT_1 (<>) is tagged private; function Create return DT_1; private type DT_1 (Size : Positive) is tagged record Data : String (1 .. Size); end record; end Discr11_Pkg;
Ada
discr11_pkg.ads
-- { dg-do compile } with Discr12_Pkg; use Discr12_Pkg; procedure Discr12 is subtype Small_Int is Integer range 1..10; package P is type PT_W_Disc (D : Small_Int) is private; type Rec_W_Private (D1 : Integer) is record C : PT_W_Disc (D1); end record; type Rec_01 (D3 : Integer) is ...
Ada
discr12.adb
package Discr12_Pkg is function Dummy (I : Integer) return Integer; end Discr12_Pkg;
Ada
discr12_pkg.ads
-- { dg-do compile } with Discr12_Pkg; use Discr12_Pkg; procedure Discr13 is function F1 return Integer is begin return Dummy (1); end F1; protected type Poe (D3 : Integer := F1) is entry E (D3 .. F1); -- F1 evaluated function Is_Ok (D3 : Integer; E_First : Integer; E_Last : Integer) return B...
Ada
discr13.adb
-- { dg-do compile } package body Discr14 is procedure ASSIGN( TARGET : in out SW_TYPE_INFO ; SOURCE : in SW_TYPE_INFO ) is begin TARGET := new T_SW_TYPE_DESCRIPTOR( SOURCE.SW_TYPE, SOURCE.DIMENSION ); end ASSIGN; end Discr14;
Ada
discr14.adb
package Discr14 is type COMPLETION_CODE is (SUCCESS, FAILURE, NONE); type T_SW_TYPE is (NONE, COMPLETION_CODE_TYPE); type T_COMPLETION_CODE_RANGE (CONSTRAINED: BOOLEAN := FALSE) is record case CONSTRAINED is when TRUE => FIRST : COMPLETION_CODE := SUCCESS; LAST : ...
Ada
discr14.ads
-- { dg-do compile } -- { dg-options "-gnatws" } with Discr15_Pkg; use Discr15_Pkg; procedure Discr15 (History : in Rec_Multi_Moment_History) is Sub: constant Rec_Multi_Moment_History := Sub_History_Of (History); subtype Vec is String(0..Sub.Last); Mmts : array(1..Sub.Size) of Vec; begin null; end;
Ada
discr15.adb
package Discr15_Pkg is type Moment is new Positive; type Multi_Moment_History is array (Natural range <>, Moment range <>) of Float; type Rec_Multi_Moment_History (Len : Natural; Size : Moment) is record Moments : Multi_Moment_History(0..Len, 1..Size); Last : Natural; end record; fu...
Ada
discr15_pkg.ads
-- { dg-do compile } with Discr16_G; with Discr16_Cont; use Discr16_Cont; procedure Discr16 is generic type T is (<>); function MAX_ADD_G(X : T; I : INTEGER) return T; function MAX_ADD_G(X : T; I : INTEGER) return T is begin return T'val(T'pos(X) + LONG_INTEGER(I)); end; function MAX_ADD is new...
Ada
discr16.adb
with Discr16_Pkg; use Discr16_Pkg; package Discr16_Cont is type ES6a is new ET3a range E2..E4; end;
Ada
discr16_cont.ads
generic type T is (<>); with function MAX_ADD(X : T; I : INTEGER) return T; package Discr16_G is LO : T := T'val(T'pos(T'first)); HI : T := T'val(T'pos(MAX_ADD(LO, 15))); type A2 is array(T range <>) of T; type R2(D : T) is record C : A2(LO..D); end record; end;
Ada
discr16_g.ads
package Discr16_Pkg is type ET3a is (E1, E2, E3, E4, E5); for ET3a use (E1=> 32_001, E2=> 32_002, E3=> 32_003, E4=> 32_004, E5=> 32_005); end;
Ada
discr16_pkg.ads
-- { dg-do compile } -- { dg-options "-gnatws" } procedure Discr17 is F1_Poe : Integer := 18; function F1 return Integer is begin F1_Poe := F1_Poe - 1; return F1_Poe; end F1; generic type T is limited private; with function Is_Ok (X : T) return Boolean; procedure Check; procedure Check...
Ada
discr17.adb
-- { dg-do compile } with Discr18_Pkg; use Discr18_Pkg; procedure Discr18 is String_10 : String (1..10) := "1234567890"; MD : Multiple_Discriminants (A => 10, B => 10) := Multiple_Discriminants'(A => 10, B => 10, S1 => String_10, ...
Ada
discr18.adb
package Discr18_Pkg is subtype Length is Natural range 0..256; type Multiple_Discriminants (A, B : Length) is tagged record S1 : String (1..A); S2 : String (1..B); end record; procedure Do_Something (Rec : in out Multiple_Discriminants); type Multiple_Discriminant_Extension...
Ada
discr18_pkg.ads
-- { dg-do compile } procedure Discr19 is type Arr_Int_T is array (Integer range <>) of Integer; type Abs_Tag_Rec_T (N : Integer; M : Integer) is abstract tagged record Arr_Int : Arr_Int_T (1..M); end record; type Tag_Rec_T (M : Integer) is new Abs_Tag_Rec_T (N => 1, M => M) with null record;...
Ada
discr19.adb
-- { dg-do compile } -- { dg-options "-gnatc" } with Discr1_Pkg; use Discr1_Pkg; package Discr1 is procedure Proc (V : Variable_String_Array); end Discr1;
Ada
discr1_1.ads
package Discr1_Pkg is Maximum_Length : Natural := 80 ; subtype String_Length is Natural range 0 .. Maximum_Length; type Variable_String (Length : String_Length := 0) is record S : String (1 .. Length); end record; type Variable_String_Array is array (Natural range <>) of Variable_String; end ...
Ada
discr1_pkg.ads
-- { dg-do compile } with discr1; use discr1; package body discr2 is procedure Copy (Dataset : in out C_Type) is Last_Char : Positive := 300; begin while (Last_Char > 40) loop Last_Char := Last_Char - 1; end loop; Assign (Dataset.Designator (1 .. Last_Char)); end; procedure D...
Ada
discr2.adb
package discr2 is procedure Dummy; end discr2;
Ada
discr2.ads
-- { dg-do compile } package body Discr20 is function Get (X : Wrapper) return Def is begin return X.It; end Get; end Discr20;
Ada
discr20.adb
package Discr20 is Size : Integer; type Name is new String (1..Size); type Rec is record It : Name; end record; type Danger is (This, That); type def (X : Danger := This) is record case X is when This => It : Rec; when That => null; end case; end record; type Switch ...
Ada
discr20.ads
-- { dg-do compile } -- { dg-options "-gnatws -O3" } with Discr21_Pkg; use Discr21_Pkg; package body Discr21 is type Index is new Natural range 0 .. 100; type Arr is array (Index range <> ) of Position; type Rec(Size : Index := 1) is record A : Arr(1 .. Size); end record; Data : Rec; function To_...
Ada
discr21.adb
package Discr21 is procedure Test; end Discr21;
Ada
discr21.ads
package Discr21_Pkg is type Position is record x,y,z : Float; end record; type Dim is (Two, Three); type VPosition (D: Dim := Three) is record x, y : Float; case D is when Two => null; when Three => z : Float; end case; end record; function To_Position (x, y, z : Float) retur...
Ada
discr21_pkg.ads
-- { dg-do compile } -- { dg-options "-gnatws" } procedure Discr22 is subtype Precision is Integer range 1 .. 5; type Rec(D1 : Precision; D2 : Integer) is record case D1 is when 1 => I : Integer; when others => null; end case; end record; for Rec use record D1 at 0 ran...
Ada
discr22.adb