summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/discr27.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gnat.dg/discr27.adb')
-rw-r--r--gcc/testsuite/gnat.dg/discr27.adb33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/discr27.adb b/gcc/testsuite/gnat.dg/discr27.adb
new file mode 100644
index 00000000000..875fe435b66
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr27.adb
@@ -0,0 +1,33 @@
+-- { dg-do compile }
+
+package body Discr27 is
+
+ subtype Index is Positive range 1..4096;
+
+ function F return String is
+ S : String(1..1) := (others =>'w');
+ begin
+ return S;
+ end;
+
+ type Enum is (One, Two);
+
+ type Rec (D : Enum := One; Len : Index := 1) is record
+ case D is
+ when One => I : Integer;
+ when Two => A : String(1..Len);
+ end case;
+ end record;
+
+ procedure Nothing is
+ M : constant String := F;
+ C : constant Rec := (Two, M'Length, M);
+ begin
+ null;
+ end;
+
+ procedure Proc is begin
+ null;
+ end;
+
+end Discr27;