opt22.adb: New test.

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
This commit is contained in:
Eric Botcazou 2011-09-26 12:41:17 +00:00 committed by Tom de Vries
parent 703ffc3005
commit 412dd7641e
4 changed files with 47 additions and 0 deletions

View 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.

View File

@ -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;

View File

@ -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;

View File

@ -0,0 +1,7 @@
package Opt22_Pkg is
procedure Fail;
procedure Put (S : String);
end Opt22_Pkg;