Commit 412dd764 by Eric Botcazou Committed by Tom de Vries

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
parent 703ffc30
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.
* gnat.dg/opt21_pkg.ad[sb]: New helper.
......
-- { 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;
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;
package Opt22_Pkg is
procedure Fail;
procedure Put (S : String);
end Opt22_Pkg;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment