Details
Diff Detail
Event Timeline
Actually, can you please add a test? The main function of llvm-c-test/echo.cpp seems to be a suitable place to set and then retrieve a diagnostic handler.
I was wondering what a suitable place for a test was. Thanks for the pointer, I'll update. Once this is in I should have a first version of a patch for the OCaml bindings exposing the diagnostic handler.
Overall I'm good with it. I'm not sure test belongs in the echo thing. I would add a new flag to llvm-c-test and just create a new kind of test. That way it would be possible to actually trigger the handler and see if it does what is expected.
I've split out the diagnostic testing and improved it a bit as suggested. Let me know what you think.
While here, I also fixed some issues with the help text printed by llvm-c-test. I hope that's fine.
Remove some unnecessary duplication introduced in the previous version of this patch.