[llvm-dev] RFC: Are auto-generated assertions a good practice?

Alexandros Lamprineas via llvm-dev llvm-dev at lists.llvm.org
Fri May 4 02:25:18 PDT 2018

Hello llvm-dev,

On a recent code review I was asked to auto-generate assertion checks for my unit test. I wasn't aware that this was even possible. I am referring to the python `update` scripts under `utils` directory. My first reaction was wow! I found it very practical and useful. It saves you significant amount of time when writing a regression test. So I gave it a try. The generated checks were satisfying enough, almost exactly what I wanted. Then I got a bit sceptical about them. I am worried that auto-generating tests based on the compiler output can be quite dangerous. The tests will always pass regardless of whether the compiler emits right or wrong code, therefore you have to be certain that they impose the desired compiler behaviour. I guess the question here is how often we should be using those scripts.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180504/5812c3bc/attachment.html>

More information about the llvm-dev mailing list