| 1 |
-- { dg-do compile } |
| 2 |
|
| 3 |
with Ada.Exceptions; |
| 4 |
|
| 5 |
package body Noreturn3 is |
| 6 |
|
| 7 |
procedure Raise_Error (E : Enum; ErrorMessage : String) is |
| 8 |
|
| 9 |
function Msg return String is |
| 10 |
begin |
| 11 |
return "Error :" & ErrorMessage; |
| 12 |
end; |
| 13 |
|
| 14 |
begin |
| 15 |
case E is |
| 16 |
when One => |
| 17 |
Ada.Exceptions.Raise_Exception (Exc1'Identity, Msg); |
| 18 |
|
| 19 |
when Two => |
| 20 |
Ada.Exceptions.Raise_Exception (Exc2'Identity, Msg); |
| 21 |
|
| 22 |
when others => |
| 23 |
Ada.Exceptions.Raise_Exception (Exc3'Identity, Msg); |
| 24 |
end case; |
| 25 |
end; |
| 26 |
|
| 27 |
end Noreturn3; |