llvm-project/llvm/test/tools/llvm-cov/mcdc-export-json.test
Alan Phipps 8ecbb0404d Reland "[Coverage][llvm-cov] Enable MC/DC Support in LLVM Source-based Code Coverage (2/3)"
Part 2 of 3. This includes the Visualization and Evaluation components.

Differential Revision: https://reviews.llvm.org/D138847
2023-12-13 15:10:05 -06:00

19 lines
700 B
Plaintext

// RUN: llvm-profdata merge %S/Inputs/mcdc-general.proftext -o %t.profdata
// RUN: llvm-cov export --format=text %S/Inputs/mcdc-general.o -instr-profile %t.profdata | FileCheck %s
// CHECK: 12,7,12,27,0,5,[true,true,true,true]
// CHECK: 15,7,15,13,0,5,[true,true]
// CHECK: 15,19,15,25,0,5,[true,false]
// CHECK: 18,7,19,15,0,5,[true,true,false,true]
// CHECK: "mcdc":{"count":12,"covered":10,"notcovered":2,"percent":83.333333333333343}
Instructions for regenerating the test:
# cd %S/Inputs
cp mcdc-general.cpp /tmp
clang -fcoverage-mcdc -fprofile-instr-generate -fcoverage-compilation-dir=. \
-fcoverage-mapping /tmp/mcdc-general.cpp -o /tmp/mcdc-const.o
mv /tmp/mcdc-general.o %S/Inputs