3 ms·
The lit test are not really "unitests" per-se, even if we try to consider them as it. We are writing them to stress a specific part of the compiler (can we vect
by Joky 11y ago
The lit test are not really "unitests" per-se, even if we try to consider them as it. We are writing them to stress a specific part of the compiler (can we vectorize this specific construct for instance), but they still involve a large chunk of the compiler.
The reason we don't have more real unittests is IMO because:
- it is hard to write (you need to mockup the analysis result that is used by the vectorizer if you want to test it in isolation).
- it adds lot of maintenance burden/overhead
- it does not add much value for the compiler over the lit tests.
- DannyBee 11y ago"The reason we don't have more real unittests is IMO because: - it is hard to write (you need to mockup the analysis result that is used by the vectorizer if you want to test it in isolation)" Right, and it's infinitely easier to just dump the result of the analysis and check that it said what you want using lit. We even have a framework explicitly to do that -analyze for opt is specifically meant to run analysis and dump their output. This doesn't test API boundaries, but the dumpers and printers are usually forced to be written in terms of the API. (and folks are starting to get religion about testing the other API boundaries)