(* RUN: rm -rf %t && mkdir -p %t && cp %s %t/diagnostic_handler.ml
* RUN: %ocamlc -g -w +A -package llvm.bitreader -linkpkg %t/diagnostic_handler.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc | FileCheck %s
* RUN: %ocamlopt -g -w +A -package llvm.bitreader -linkpkg %t/diagnostic_handler.ml -o %t/executable
* RUN: %t/executable %t/bitcode.bc | FileCheck %s
* XFAIL: vg_leak
*)
let context = global_context (
printf
"Diagnostic handler called: %s\n" ;
match severity d printf "Diagnostic severity is Error\n"
printf "Diagnostic severity is Warning\n"
printf "Diagnostic severity is Remark\n"
printf "Diagnostic severity is Note\n"
if not x then exit 1 else (
let _ =
set_diagnostic_handler context ;
(* corrupt the bitcode *)
let fn = argv. ^ ".txt" in
;
test