Debian Codegraph @

gcc/testsuite/gnat.dg/no_caching.adb

raw
1 -- { dg-do compile }
2
3 package body No_Caching with SPARK_Mode is
4 Status : Boolean;
5
6 procedure Handle (V : Mult_Bit_Boolean) is
7 Ret_Val : Mult_Bit_Boolean := V with Volatile, No_Caching;
8 begin
9 if (Ret_Val = NV_TRUE) then
10 Do_Something;
11 elsif (Ret_Val = NV_FALSE) then
12 Do_Something_Else;
13 else
14 null;
15 -- Fault inject detected. Take punitive action
16 end if;
17 end Handle;
18
19 procedure Do_Something is
20 begin
21 Status := True;
22 end Do_Something;
23
24 procedure Do_Something_Else is
25 begin
26 Status := False;
27 end Do_Something_Else;
28
29 end No_Caching;