You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Constant folding yields too high MCDC coverage (Rust)
Criticality: MEDIUM
During qualification of MCDC coverage at Validas we found that
constant folding produces wrong (too high) coverage results in case of incomplete coverage.
In the following example where the term "(true || true) && v2" contains constants we would
expect that 1 / 3 atoms are covered (= 33.3 % MCDC), but LLVM Cov measures 50 % MCDC.
Since coverage is less than 100% a manual analysis and explanation is required, therefore the safety cirticality is not high.
Note: For the same example in C++ 100 % MCDC is measured by llvm-cov (see #109940)
The second paragraph at the comment under #109940 have answered why rust shows 50% coverage for your case.
Briefly, rustc tells llvm 3 mappings, only 1 of which is taken as constant by llvm (as that comment said, only the second constant true has two counters encoded to Zero). Then because llvm does not count constant conditions now, you get 1/2 (1 for v2 and 2 for v2, the first constant true).
Constant folding yields too high MCDC coverage (Rust)
Criticality: MEDIUM
During qualification of MCDC coverage at Validas we found that
constant folding produces wrong (too high) coverage results in case of incomplete coverage.
In the following example where the term "(true || true) && v2" contains constants we would
expect that 1 / 3 atoms are covered (= 33.3 % MCDC), but LLVM Cov measures 50 % MCDC.
Since coverage is less than 100% a manual analysis and explanation is required, therefore the safety cirticality is not high.
Note: For the same example in C++ 100 % MCDC is measured by llvm-cov (see #109940)
Example Source Code:
Test_000005.zip
The text was updated successfully, but these errors were encountered: