[sledge] Report the number of alarms

Summary:
For test scripting purposes, when the analysis finishes successfully,
report the number of alarms.

Reviewed By: ngorogiannis

Differential Revision: D17801947

fbshipit-source-id: 1660866df
master
Josh Berdine 5 years ago committed by Facebook Github Bot
parent ec52c05c30
commit ef78ba83cf

@ -22,7 +22,11 @@ let unknown_call call =
| _ -> () ) | _ -> () )
call Llair.Term.pp call] call Llair.Term.pp call]
let count = ref 0
let invalid_access_count () = !count
let invalid_access fmt_thunk pp access loc = let invalid_access fmt_thunk pp access loc =
Int.incr count ;
let rep fs = let rep fs =
Format.fprintf fs "%a Invalid memory access@;<1 2>@[%a@]" Loc.pp Format.fprintf fs "%a Invalid memory access@;<1 2>@[%a@]" Loc.pp
(loc access) pp access (loc access) pp access

@ -10,3 +10,4 @@
val unknown_call : Llair.term -> unit val unknown_call : Llair.term -> unit
val invalid_access_inst : (Formatter.t -> unit) -> Llair.inst -> unit val invalid_access_inst : (Formatter.t -> unit) -> Llair.inst -> unit
val invalid_access_term : (Formatter.t -> unit) -> Llair.term -> unit val invalid_access_term : (Formatter.t -> unit) -> Llair.term -> unit
val invalid_access_count : unit -> int

@ -42,7 +42,8 @@ let command ~summary ?readme param =
try try
main () |> ignore ; main () |> ignore ;
Trace.flush () ; Trace.flush () ;
Format.printf "@\nRESULT: Success@." Format.printf "@\nRESULT: Success: Invalid Accesses: %i@."
(Report.invalid_access_count ())
with exn -> with exn ->
let bt = Caml.Printexc.get_raw_backtrace () in let bt = Caml.Printexc.get_raw_backtrace () in
Trace.flush () ; Trace.flush () ;

Loading…
Cancel
Save