Skip to content

[llvm-cov][MC/DC][Qualification] Boolean Terms with XOR are not analyzed correctly for MCDC coverage #109951

@escherle-validas

Description

@escherle-validas

Boolean Terms with XOR are not analyzed correctly for MCDC coverage

Criticality: HIGH

During qualification of MCDC coverage at Validas we found that
In the following example the term “(v0^v1) && v2” is not analyzed correctly.
the exclusive operator ^ takes two boolean inputs and produces a boolean output.
Therefore it has to be instrumented as well such that the impact from v0 to the result can be analyzed.
This results in a wrongly calculated MCDC coverage measured by LLVMCov.
Note: In plain C there is no native boolean type defined, therefore instrumentation is restricted to && and ||,
but for C++ and Rust the boolean type exists and therefore operators on it should be considered for MCDC coverage.
The problem occurs within Rust and C++.

Rust example:
XOR_one_atom_rust
Source Code and generated reports:
Test_000009.zip

C++ example:
XOR_one_atom_cpp
Source Code and generated reports:
Test_000009.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions