]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gnat.dg/opt78.ad[sb]: New test.
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 23 May 2019 09:50:21 +0000 (09:50 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 23 May 2019 09:50:21 +0000 (09:50 +0000)
From-SVN: r271546

gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/opt78.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/opt78.ads [new file with mode: 0644]

index 76810e08d4bb3336072da8f22c99956657ba4161..7b891bc9f2d151194b0768640e3cc0dd8736a8f3 100644 (file)
@@ -1,3 +1,7 @@
+2019-05-23  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/opt78.ad[sb]: New test.
+
 2019-05-22  Uroš Bizjak  <ubizjak@gmail.com>
 
        Backported from mainline
diff --git a/gcc/testsuite/gnat.dg/opt78.adb b/gcc/testsuite/gnat.dg/opt78.adb
new file mode 100644 (file)
index 0000000..e46c92b
--- /dev/null
@@ -0,0 +1,16 @@
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+package body Opt78 is
+
+   procedure Proc (P : UC; Msg : String) is
+      Default : UC := (1, "!");
+   begin
+      if P = Default then
+         raise Program_Error;
+      else
+         raise Constraint_Error;
+      end if;
+   end;
+
+end Opt78;
diff --git a/gcc/testsuite/gnat.dg/opt78.ads b/gcc/testsuite/gnat.dg/opt78.ads
new file mode 100644 (file)
index 0000000..2c489bd
--- /dev/null
@@ -0,0 +1,13 @@
+package Opt78 is
+
+   subtype Reasonable is Integer range 1..10;
+
+   type UC (D: Reasonable := 2) is record
+      S: String (1 .. D) := "Hi";
+   end record;
+
+   type AUC is access all UC;
+
+   procedure Proc (P : UC; Msg : String);
+
+end Opt78;