summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r--gcc/testsuite/gnat.dg/discr27.adb2
-rw-r--r--gcc/testsuite/gnat.dg/discr27.ads2
-rw-r--r--gcc/testsuite/gnat.dg/discr28.adb25
-rw-r--r--gcc/testsuite/gnat.dg/discr28.ads19
-rw-r--r--gcc/testsuite/gnat.dg/discr28_pkg.ads5
5 files changed, 51 insertions, 2 deletions
diff --git a/gcc/testsuite/gnat.dg/discr27.adb b/gcc/testsuite/gnat.dg/discr27.adb
index cfaba34c2f9..875fe435b66 100644
--- a/gcc/testsuite/gnat.dg/discr27.adb
+++ b/gcc/testsuite/gnat.dg/discr27.adb
@@ -1,3 +1,5 @@
+-- { dg-do compile }
+
package body Discr27 is
subtype Index is Positive range 1..4096;
diff --git a/gcc/testsuite/gnat.dg/discr27.ads b/gcc/testsuite/gnat.dg/discr27.ads
index db1914accc3..247134a9916 100644
--- a/gcc/testsuite/gnat.dg/discr27.ads
+++ b/gcc/testsuite/gnat.dg/discr27.ads
@@ -1,5 +1,3 @@
--- { dg-do compile }
-
package Discr27 is
procedure Proc;
diff --git a/gcc/testsuite/gnat.dg/discr28.adb b/gcc/testsuite/gnat.dg/discr28.adb
new file mode 100644
index 00000000000..97ca8cd68b7
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr28.adb
@@ -0,0 +1,25 @@
+-- { dg-do compile }
+
+package body Discr28 is
+
+ procedure Dummy (E : Rec) is
+ begin
+ null;
+ end;
+
+ function F return Rec is
+ begin
+ return Default_Rec;
+ end;
+
+ procedure Proc1 is
+ begin
+ Dummy (F);
+ end;
+
+ procedure Proc2 is
+ begin
+ Dummy (F);
+ end;
+
+end Discr28;
diff --git a/gcc/testsuite/gnat.dg/discr28.ads b/gcc/testsuite/gnat.dg/discr28.ads
new file mode 100644
index 00000000000..3288b52bfcb
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr28.ads
@@ -0,0 +1,19 @@
+with Discr28_Pkg;
+
+package Discr28 is
+
+ type Enum is (One, Two);
+
+ type Rec (D : Enum := One) is record
+ case D is
+ when One => null;
+ when Two => S : String (1 .. Discr28_Pkg.N);
+ end case;
+ end record;
+
+ Default_Rec : constant Rec := (D => One);
+
+ procedure Proc1;
+ procedure Proc2;
+
+end Discr28;
diff --git a/gcc/testsuite/gnat.dg/discr28_pkg.ads b/gcc/testsuite/gnat.dg/discr28_pkg.ads
new file mode 100644
index 00000000000..f6be834eedc
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr28_pkg.ads
@@ -0,0 +1,5 @@
+package Discr28_Pkg is
+
+ function N return Natural;
+
+end Discr28_Pkg;