summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-30 12:01:55 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-30 12:01:55 +0000
commit99eae3030dc96cee5d454806334b5b28282e9fbe (patch)
tree5828204a3c6b0360ef04bfe89a699185c8995230 /gcc/testsuite/gnat.dg
parent474db1198e42852de5f5a47f4a5dda18cafaa565 (diff)
downloadgcc-99eae3030dc96cee5d454806334b5b28282e9fbe.tar.gz
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Task_Type>: Reuse the
TYPE_DECL of the equivalent type instead of building a new one. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r--gcc/testsuite/gnat.dg/prot2.adb23
-rw-r--r--gcc/testsuite/gnat.dg/prot2.ads5
-rw-r--r--gcc/testsuite/gnat.dg/prot2_pkg1.ads5
-rw-r--r--gcc/testsuite/gnat.dg/prot2_pkg2.adb23
-rw-r--r--gcc/testsuite/gnat.dg/prot2_pkg2.ads17
5 files changed, 73 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/prot2.adb b/gcc/testsuite/gnat.dg/prot2.adb
new file mode 100644
index 00000000000..cc6fcab8fe6
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/prot2.adb
@@ -0,0 +1,23 @@
+-- { dg-do compile }
+
+with Prot2_Pkg1;
+with Prot2_Pkg2;
+
+package body Prot2 is
+
+ type A is array (1 .. Prot2_Pkg1.Num) of Integer;
+
+ type E is (One, Two);
+
+ type Rec (D : E := One) is record
+ case D is
+ when One => L : A;
+ when Two => null;
+ end case;
+ end record;
+
+ package My_Pkg2 is new Prot2_Pkg2 (Rec);
+
+ procedure Dummy is begin null; end;
+
+end Prot2;
diff --git a/gcc/testsuite/gnat.dg/prot2.ads b/gcc/testsuite/gnat.dg/prot2.ads
new file mode 100644
index 00000000000..d388fc7d097
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/prot2.ads
@@ -0,0 +1,5 @@
+package Prot2 is
+
+ procedure Dummy;
+
+end Prot2;
diff --git a/gcc/testsuite/gnat.dg/prot2_pkg1.ads b/gcc/testsuite/gnat.dg/prot2_pkg1.ads
new file mode 100644
index 00000000000..2e71aacfcdc
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/prot2_pkg1.ads
@@ -0,0 +1,5 @@
+package Prot2_Pkg1 is
+
+ function Num return Natural;
+
+end Prot2_Pkg1;
diff --git a/gcc/testsuite/gnat.dg/prot2_pkg2.adb b/gcc/testsuite/gnat.dg/prot2_pkg2.adb
new file mode 100644
index 00000000000..503cce73d17
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/prot2_pkg2.adb
@@ -0,0 +1,23 @@
+with Unchecked_Deallocation;
+
+package body Prot2_Pkg2 is
+
+ protected type Rec is
+ private
+ M : T;
+ end Rec;
+
+ protected body Rec is end;
+
+ procedure Create (B : out Id) is
+ begin
+ B := new Rec;
+ end;
+
+ procedure Delete (B : in out Id) is
+ procedure Free is new Unchecked_Deallocation(Object => Rec, Name => Id);
+ begin
+ Free (B);
+ end;
+
+end Prot2_Pkg2;
diff --git a/gcc/testsuite/gnat.dg/prot2_pkg2.ads b/gcc/testsuite/gnat.dg/prot2_pkg2.ads
new file mode 100644
index 00000000000..cdd436b8afb
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/prot2_pkg2.ads
@@ -0,0 +1,17 @@
+generic
+
+ type T is private;
+
+package Prot2_Pkg2 is
+
+ type Id is private;
+
+ procedure Create (B : out Id);
+ procedure Delete (B : in out Id);
+
+private
+
+ type Rec;
+ type Id is access Rec;
+
+end Prot2_Pkg2;