Add regression test
gcc/testsuite/ PR ada/114593 * gnat.dg/specs/generic_inst2-child2.ads: New test. * gnat.dg/specs/generic_inst2.ads: New helper. * gnat.dg/specs/generic_inst2-child1.ads: Likewise.
This commit is contained in:
parent
03623fa91f
commit
df25d528d3
3 changed files with 38 additions and 0 deletions
17
gcc/testsuite/gnat.dg/specs/generic_inst2-child1.ads
Normal file
17
gcc/testsuite/gnat.dg/specs/generic_inst2-child1.ads
Normal file
|
@ -0,0 +1,17 @@
|
|||
generic
|
||||
package Generic_Inst2.Child1 is
|
||||
|
||||
function Get_Custom return Custom_Type;
|
||||
|
||||
private
|
||||
|
||||
type Dummy is null record;
|
||||
|
||||
Placeholder : constant Dummy := (null record);
|
||||
|
||||
-- This type conversion fails (though only when
|
||||
-- instantiated in the other package)
|
||||
function Get_Custom return Custom_Type is
|
||||
(Custom_Type(Placeholder'Address));
|
||||
|
||||
end Generic_Inst2.Child1;
|
10
gcc/testsuite/gnat.dg/specs/generic_inst2-child2.ads
Normal file
10
gcc/testsuite/gnat.dg/specs/generic_inst2-child2.ads
Normal file
|
@ -0,0 +1,10 @@
|
|||
-- { dg-do compile }
|
||||
|
||||
with Generic_Inst2.Child1;
|
||||
|
||||
generic
|
||||
package Generic_Inst2.Child2 is
|
||||
|
||||
package Second is new Generic_Inst2.Child1;
|
||||
|
||||
end Generic_Inst2.Child2;
|
11
gcc/testsuite/gnat.dg/specs/generic_inst2.ads
Normal file
11
gcc/testsuite/gnat.dg/specs/generic_inst2.ads
Normal file
|
@ -0,0 +1,11 @@
|
|||
private with System;
|
||||
|
||||
package Generic_Inst2 is
|
||||
|
||||
type Custom_Type is private;
|
||||
|
||||
private
|
||||
|
||||
type Custom_Type is new System.Address;
|
||||
|
||||
end Generic_Inst2;
|
Loading…
Add table
Reference in a new issue