https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115047

Wentao Zhang <wentaoz5 at illinois dot edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Wentao Zhang <wentaoz5 at illinois dot edu> ---
Jørgen, thank you for the info! I just realized this had been somewhat
discussed
between you and Alan on LLVM discourse [2]. From Alan's description I think
LLVM
is adopting unique-cause MC/DC. I might explicitly ask them for confirmation.

> does f(0, 0, 1); f(0, 0, 0); cover c?

Yes

    1|      2|void f(int a, int b, int c) { a && b || c; }
  ------------------
  |---> MC/DC Decision Region (1:31) to (1:42)
  |
  |  Number of Conditions: 3
  |     Condition C1 --> (1:31)
  |     Condition C2 --> (1:36)
  |     Condition C3 --> (1:41)
  |
  |  Executed MC/DC Test Vectors:
  |
  |     C1, C2, C3    Result
  |  1 { F,  -,  F  = F      }
  |  2 { F,  -,  T  = T      }
  |
  |  C1-Pair: not covered
  |  C2-Pair: not covered
  |  C3-Pair: covered: (1,2)
  |  MC/DC Coverage for Decision: 33.33%
  |
  ------------------
    2|      1|int main(void) {
    3|      1|    f(0,0,1);
    4|      1|    f(0,0,0);
    5|      1|    return 0;
    6|      1|}
    7|       |

I guess it would be desirable to (1) let LLVM support masking MC/DC and (2) let
gcov support unique-cause MC/DC. The first seems easier and I might try
implementing a prototype.

[2] https://discourse.llvm.org/t/rfc-source-based-mc-dc-code-coverage/59244/9

Thanks,
Wentao

Reply via email to