aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gnat.dg/noreturn5.adb
blob: 59b05da92feee1e2baa7981a4334f2cd3c12762f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- { dg-do compile }

with Ada.Characters.Handling; use Ada.Characters.Handling;
with GNAT.OS_Lib;             use GNAT.OS_Lib;
with Text_IO;                 use Text_IO;

package body Noreturn5 is

   procedure Proc (Arg_Line : Wide_String; Keep_Going : Boolean) is
   begin
      Put (To_String (Arg_Line));

      if Keep_Going then
         raise Constraint_Error;
      else
         OS_Exit (1);
      end if;

   exception
      when Constraint_Error =>
         raise;

      when others =>
         if Keep_Going then
            raise Constraint_Error;
         else
            OS_Exit (1);
         end if;

   end;

end Noreturn5;