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
+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.
--- /dev/null
+-- { 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;
--- /dev/null
+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;
--- /dev/null
+package Opt22_Pkg is
+
+ procedure Fail;
+
+ procedure Put (S : String);
+
+end Opt22_Pkg;