When compiling with optimization, LLVM will sometimes optimize out faulty IR we generated. The same IR can lead to segfaults when compiling without optimizations - this leaves quite a large gap in our automated test-coverage and will cause bugs to slip through.
When compiling with optimization, LLVM will sometimes optimize out faulty IR we generated. The same IR can lead to segfaults when compiling without optimizations - this leaves quite a large gap in our automated test-coverage and will cause bugs to slip through.
Here's an example (which is already on master, running - and passing - with every test-run) I stumbled upon while working on initializing temporary variables: https://github.com/PLC-lang/rusty/blob/cbe548d2485d1c1df2ca02772a00ddd1c433b1c8/tests/lit/single/init/function_locals.st#L1-L27
This lit test will pass the CI without problems, however, if the same code is compiled with
-Onone
it leads to a segfault when executed.We should update our runner so that all LIT tests are ran with default optimization as well as with
-Onone
.