-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[llvm-cov][MC/DC][Qualification] Wrong computation of conditions #110090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Since we have no reply from you yet, I would like to ask for a status update for this issue. Are there any plans how this will be handled? |
Not sure which version of rust you used. I check it on the latest nightly rustc and it shows
It's because rust's "nested decision" mechanism. As you have checked, "==" and "!=" are not considered as logical operations by rust for now. So rust first sees the whole statement, which is in form of Then rust looks into the inner statements, and finds that As for In rust's sight, D2 and D3 are nested in D1. But D1 only contains one condition, so it is ignored by mcdc checker. Rust mcdc always ignores decisions with only one condition because it's totally equivalent to branch coverage (Actually we can even prove it's true for decisions with two conditions, but not so clear). Hence only D2 and D3 left and rust shows results as above. The result is also not right. The reason is the constant issue clarified at #109940 . Thus the last issue is "==" and "!=" are not recognized as logical operations, same as #109947 . |
Wrong computation of conditions
Criticality: MEDIUM
In the attached example there are 10 conditions, however the tool
a) splits up the entire decision in 2 separate decisions with 3 conditions each (for C++) and
b) computes only 3 conditions (for Rust).
Also the specified "positions" are wrong, i.e. do not point to the right places.
Furthermore it is critical, that Rust and C++ differ.
Rust:

Source code and generated reports:
Test_000010.zip
C++

Source code and generated reports:
Test_000010.zip
The text was updated successfully, but these errors were encountered: