Debian Codegraph @

gcc/testsuite/gnat.dg/predicate3.adb

raw
1 -- { dg-do run }
2 -- { dg-options "-gnata" }
3
4 with Ada.Assertions, Ada.Text_IO;
5 use Ada.Assertions, Ada.Text_IO;
6
7 with Predicate3_Pkg;
8 use Predicate3_Pkg;
9
10 procedure Predicate3 is
11 Got_Assertion : Boolean := False;
12 begin
13
14 begin
15 Put_Line (Good (C)'Image);
16 exception
17 when Assertion_Error =>
18 Got_Assertion := True;
19 end;
20
21 if not Got_Assertion then
22 raise Program_Error;
23 end if;
24
25 Got_Assertion := False;
26 declare
27 X: Priv;
28 begin
29 X := Wrong;
30 exception
31 when Assertion_Error =>
32 Got_Assertion := True;
33 end;
34
35 if not Got_Assertion then
36 raise Program_Error;
37 end if;
38
39 end Predicate3;