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:
parent
703ffc3005
commit
412dd7641e
|
@ -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.
|
||||
|
|
|
@ -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;
|
|
@ -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;
|
|
@ -0,0 +1,7 @@
|
|||
package Opt22_Pkg is
|
||||
|
||||
procedure Fail;
|
||||
|
||||
procedure Put (S : String);
|
||||
|
||||
end Opt22_Pkg;
|
Loading…
Reference in New Issue