]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
opt22.adb: New test.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 26 Sep 2011 12:41:17 +0000 (12:41 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Mon, 26 Sep 2011 12:41:17 +0000 (12:41 +0000)
2011-09-26  Eric Botcazou  <ebotcazou@adacore.com>

* gnat.dg/opt22.adb: New test.
* gnat.dg/opt22_pkg.ad[sb]: New helper.

From-SVN: r179194

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

index 2546ce138a9fb131a746476dc312b0992283f550..35dea739f782d1d6ff47b4426af23f59e8e6b1a8 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-26  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/opt22.adb: New test.
+       * gnat.dg/opt22_pkg.ad[sb]: New helper.
+
 2011-09-26  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/opt21.adb: New test.
diff --git a/gcc/testsuite/gnat.dg/opt22.adb b/gcc/testsuite/gnat.dg/opt22.adb
new file mode 100644 (file)
index 0000000..6ea2440
--- /dev/null
@@ -0,0 +1,20 @@
+-- { dg-do run }
+-- { dg-options "-O" }
+
+with Opt22_Pkg; use Opt22_Pkg;
+
+procedure Opt22 is
+
+   procedure Go (S : String) is
+   begin
+      begin
+        Fail;
+      exception
+        when Constraint_Error => Put ("the " & S);
+      end;
+      Put ("the " & S);
+   end;
+
+begin
+   Go ("message");
+end;
diff --git a/gcc/testsuite/gnat.dg/opt22_pkg.adb b/gcc/testsuite/gnat.dg/opt22_pkg.adb
new file mode 100644 (file)
index 0000000..fa05dfe
--- /dev/null
@@ -0,0 +1,15 @@
+package body Opt22_Pkg is
+
+   procedure Fail is
+   begin
+      raise Constraint_Error;
+   end;
+
+   procedure Put (S : String) is
+   begin
+      if S /= "the message" then
+         raise Program_Error;
+      end if;
+   end;
+
+end Opt22_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt22_pkg.ads b/gcc/testsuite/gnat.dg/opt22_pkg.ads
new file mode 100644 (file)
index 0000000..2822409
--- /dev/null
@@ -0,0 +1,7 @@
+package Opt22_Pkg is
+
+   procedure Fail;
+
+   procedure Put (S : String);
+
+end Opt22_Pkg;