--  The checks Program_Exit and Exit_Cases make (G7): each failure below is reported.
package Checks with SPARK_Mode is
   Done : Boolean := False;

   --  calls OS_Exit without Program_Exit of its own (B5120)
   procedure Quit;

   --  its Program_Exit condition does not hold when it exits (B5120)
   procedure Quit_Unset
     with Global => (In_Out => Done), Program_Exit => Done;

   --  exits where its exit cases say it returns (B5121), and its two guards overlap (B5121)
   procedure Maybe_Quit (Code : Integer)
     with Program_Exit,
          Exit_Cases => (Code > 0 => Normal_Return, Code > 5 => Program_Exit, others => Normal_Return);
end Checks;
