<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/130760>130760</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Coverage][MC/DC] Condition position reported at macro position
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ManuelvOK
</td>
</tr>
</table>
<pre>
When using macros in conditions, the MC/DC report sais the position of those conditions is where the macro is.
Example:
```cpp
#define ID(exp) exp
int main(void) {
int a = 1;
int b = 1;
if (ID(a == 1) && b == 1) {
return 0;
}
return 1;
}
```
The condition `ID(a == 1)` is located in line 7 but the MC/DC report will say it is in line 1:
```
1| 2|#define ID(exp) exp
2| |
3| 1|int main(void) {
4| 1| int a = 1;
5| 1| int b = 1;
6| |
7| 1| if (ID(a == 1) && b == 1) {
------------------
|---> MC/DC Decision Region (7:9) to (7:29)
|
| Number of Conditions: 2
| Condition C1 --> (1:17)
| Condition C2 --> (7:23)
|
| Executed MC/DC Test Vectors:
|
| C1, C2 Result
| 1 { T, T = T }
|
| C1-Pair: not covered
| C2-Pair: not covered
| MC/DC Coverage for Decision: 0.00%
|
------------------
8| 1| return 0;
9| 1| }
10| 0| return 1;
11| 1|}
```
I would expect the report to refer to the actual position inside the decision.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVVuP6jYQ_jXDy2iR7dwf8sAmi3RUnbY6Qu2zSQbiKsTIdtjdf185FwIL3YcipNgz31w_jy2tVceOKIfoFaJyJXvXaJP_lF1P7eWP31Z7XX_mfzfUYW9Vd8STrIy2qDqsdFcrp3RnQRToGsKfBYhtWaChszYOrVR2kJ-1HYCoD-gabenGFpXF94YMDcjBOyq7BrYBtnn7kKdzSxBsxj3EbPxX57PfiqCmg-oIf5QgUvo4g8jQfwa06hyepOpApBetaq-D5BXYBhHRKyVCUCKH4Fa4vxXO8gOCSIcgg82I8P5ED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