]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add regression test
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 8 Oct 2024 13:08:15 +0000 (15:08 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Tue, 8 Oct 2024 16:01:22 +0000 (18:01 +0200)
gcc/testsuite/
PR ada/114636
* gnat.dg/specs/generic_inst1.ads: New test.

gcc/testsuite/gnat.dg/specs/generic_inst1.ads [new file with mode: 0644]

diff --git a/gcc/testsuite/gnat.dg/specs/generic_inst1.ads b/gcc/testsuite/gnat.dg/specs/generic_inst1.ads
new file mode 100644 (file)
index 0000000..fdf48c0
--- /dev/null
@@ -0,0 +1,32 @@
+-- { dg-do compile }
+
+package Generic_Inst1 is
+
+   generic
+      type Terminals is (<>);
+      type Nonterminals is (<>);
+   package Types is
+      type Action is record
+         data : Integer;
+      end record;
+   end Types;
+
+   generic
+      type States is (<>);
+      type Input_T is (<>);
+      type Action_T is private;
+   package FSM is
+   end FSM;
+
+   generic
+      with package Typs is new Types (<>);
+      with package SMs is new FSM
+        (States => <>, Input_T => Typs.Terminals, Action_T => Typs.Action);
+   package Gen is
+   end Gen;
+
+   package Typs is new Types (Natural, Integer);
+   package SMs is new FSM (Integer, Natural, Typs.Action);
+   package Generator is new Gen (Typs, SMs);
+
+end Generic_Inst1;