<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/109951>109951</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [llvm-cov][MC/DC][Qualification] Boolean Terms with XOR are not analyzed correctly for MCDC coverage
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          escherle-validas
      </td>
    </tr>
</table>

<pre>
    # 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](https://github.com/user-attachments/assets/42045589-4e17-402c-adf1-e3dd945954f3)
Source Code and generated reports:
[Test_000009.zip](https://github.com/user-attachments/files/17129197/Test_000009.zip)

C++ example:
![XOR_one_atom_cpp](https://github.com/user-attachments/assets/0bf36888-f100-47c9-b7b6-198156bcf4c8)
Source Code and generated reports:
[Test_000009.zip](https://github.com/user-attachments/files/17129208/Test_000009.zip)


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVV2PozYX_jXOzRGRcSCBCy42ZPLuSDvvqtPRau9GxhyCW2NTf5DJ_vrKkMx0WvVDq140iiDBh-c8H7YOd06eNGJF8j3JDysefG9shU70aBUmE1ey5W7VmPZSEbaBvTEKuYYntIODs_Q9fP38CNwiaOOBa64u37AFYaxF4dUFOmPhoT7UIMyElp-Q0AOhHwjbRLzaSi8FV9JfyOY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