diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-10-14 11:57:57 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2024-10-14 11:59:30 +0200 |
commit | df25d528d36352af9dd677a4d67e44fa5ed5dc43 (patch) | |
tree | 6ea53fc61e509d986af0a4048948558582980307 /gcc | |
parent | 03623fa91ff36ecb9faa3b55f7842a39b759594e (diff) | |
download | gcc-df25d528d36352af9dd677a4d67e44fa5ed5dc43.zip gcc-df25d528d36352af9dd677a4d67e44fa5ed5dc43.tar.gz gcc-df25d528d36352af9dd677a4d67e44fa5ed5dc43.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gnat.dg/specs/generic_inst2-child1.ads | 17 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/specs/generic_inst2-child2.ads | 10 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/specs/generic_inst2.ads | 11 |
3 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/specs/generic_inst2-child1.ads b/gcc/testsuite/gnat.dg/specs/generic_inst2-child1.ads new file mode 100644 index 0000000..18e212b --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/generic_inst2-child1.ads @@ -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; diff --git a/gcc/testsuite/gnat.dg/specs/generic_inst2-child2.ads b/gcc/testsuite/gnat.dg/specs/generic_inst2-child2.ads new file mode 100644 index 0000000..3bb5b0a --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/generic_inst2-child2.ads @@ -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; diff --git a/gcc/testsuite/gnat.dg/specs/generic_inst2.ads b/gcc/testsuite/gnat.dg/specs/generic_inst2.ads new file mode 100644 index 0000000..0a74e36 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/generic_inst2.ads @@ -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; |