File tree Expand file tree Collapse file tree 8 files changed +41
-1
lines changed
testsuite/gnat2goto/tests Expand file tree Collapse file tree 8 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -1487,9 +1487,11 @@ package body Tree_Walk is
14871487 -- (via `Register_Type_Declaration') when its
14881488 -- private or incomplete_type_declaration was processed.
14891489 -- If it has no private declaration or the Incomplete_View is not
1490- -- present then the full_type_declaration has to be registered
1490+ -- present or it is a derived_type_definition
1491+ -- then the full_type_declaration has to be registered
14911492 if not (Has_Private_Declaration (E)
14921493 or else Present (Incomplete_View (N)))
1494+ or else Nkind (Type_Definition (N)) = N_Derived_Type_Definition
14931495 then
14941496 Do_Type_Declaration (New_Type, E);
14951497
Original file line number Diff line number Diff line change 1+ with Private_Type ; use Private_Type;
2+ procedure Derived_Private_Type is
3+ type Derived_Priv is new Priv;
4+ V_Priv : Priv := Priv_Const;
5+ V_D_Priv : Derived_Priv := Derived_Priv (Priv_Const);
6+ begin
7+ pragma Assert (Derived_Priv (V_Priv) = V_D_Priv);
8+ null ;
9+ end Derived_Private_Type ;
Original file line number Diff line number Diff line change 1+ package Private_Type is
2+ type Priv is private ;
3+ Priv_Const : constant Priv;
4+ private
5+ type Priv is new Integer range 1 .. 23 ;
6+ Priv_Const : constant Priv := 17 ;
7+ end Private_Type ;
Original file line number Diff line number Diff line change 1+ [1] file derived_private_type.adb line 7 assertion: SUCCESS
2+ VERIFICATION SUCCESSFUL
Original file line number Diff line number Diff line change 1+ from test_support import *
2+
3+ prove ()
Original file line number Diff line number Diff line change 1+ procedure Derived_Types is
2+ type My_Int is range -23 .. 23 ;
3+ type My_Real is new Float;
4+
5+ begin
6+ pragma Assert (0 in My_Int);
7+ pragma Assert (11.0 in My_Real);
8+ pragma Assert (My_Int'Succ (22 ) = 23 );
9+ null ;
10+ end Derived_Types ;
Original file line number Diff line number Diff line change 1+ [1] file derived_types.adb line 6 assertion: SUCCESS
2+ [2] file derived_types.adb line 7 assertion: SUCCESS
3+ [3] file derived_types.adb line 8 assertion: SUCCESS
4+ VERIFICATION SUCCESSFUL
Original file line number Diff line number Diff line change 1+ from test_support import *
2+
3+ prove ()
You can’t perform that action at this time.
0 commit comments