News for hackers. Stuff that matters.
Re:Clang-11.0.0 Miscompiled SQLite by lanza on Thursday June 04, 2020 @01:21PM (#23419252)
llvm has a very thorough test suite and it's main test suite is exactly for this purpose. The error witnessed here by sqlite will be turned into a test case that takes the C code and compiles it and hand checks whether the output was miscompiled or not.

Here's a test from 2007 that tests a similar error in the instruction selector:

https://github.com/llvm-project/llvm/blob/master/test/CodeGe...

Evidently the error that caused this test to be rewritten reordered the `ret` instruction before the `mov $1, $eax` instruction that sets the return value. This tests assures that the bug will never happen again.

There are no comments on this comment yet.