- Home
- Test Coverage Tools
- LLVM llvm-cov
LLVM llvm-cov
What it is
LLVM llvm-cov is a developer tool for examining code coverage in programs built with instrumentation to produce profile data. It supports gcov-style coverage and Clang instrumentation-based profiling, with coverage types that include function, instantiation, line, region, branch, and MC/DC. Its commands include gcov, show, report, and export. Show can display coverage line by line and filter results to selected source files; report can summarize coverage, including branch, function, and MC/DC statistics. Output formats include text, HTML, JSON, and LCOV. JSON can include regions, functions, branches, expansions, and summaries. Inputs may be executables, object files, dynamic libraries, or archives. The workflow requires building and running an instrumented program, then processing raw profile data with llvm-profdata merge. The gcov command is compatible with gcov from GCC 4.2 and may work with some later versions. LLVM lists llvm-cov for Linux, macOS, and Windows. It is free, with a self-hosted option.
For and against
For
- Supports line, branch, function, and MC/DC coverage.
- Can filter line reports to selected source files.
- Produces text, HTML, JSON, and LCOV reports.
- Available for Linux, macOS, and Windows.
Against
- Requires an instrumented build and profile data.
- LLVM warns its components are not hardened against malicious input.
The verdict
LLVM llvm-cov offers several ways to inspect and export coverage data, from source-line detail to summary statistics. Its use depends on producing profile data through an instrumented program first.
Who it suits
It suits developers examining coverage in instrumented C, C++, Objective-C, or Objective-C++ programs. It is also relevant to teams that need line-level views or summary reports in several formats.
Plans and prices
LLVM llvm-cov
Open source LLVM tool; no paid plans or usage limits stated
Read 5 Oct 2026 · releases.llvm.org
On the record
- Audience
- The tool is for examining code coverage of instrumented programs; LLVM documents it as part of its developer toolchain.llvm.org · read 5 Oct 2026
- Commands
- The documented commands include gcov, show, report, and export.llvm.org · read 5 Oct 2026
- Compatibility
- The gcov subcommand is compatible with gcov from GCC 4.2 and may work with some later gcov versions.llvm.org · read 5 Oct 2026
- Coverage modes
- It works with gcov-style coverage or Clang instrumentation-based profiling.llvm.org · read 5 Oct 2026
- Downloads
- The LLVM release page says source packages and Git tags are signed by release managers and provides keys for verification.releases.llvm.org · read 5 Oct 2026
- Export formats
- Coverage can be exported as JSON or lcov trace format, with regions, functions, branches, expansions, and summaries available in JSON.llvm.org · read 5 Oct 2026
- HTML reports
- Clang's source-based coverage guide says llvm-cov can generate HTML reports.clang.llvm.org · read 5 Oct 2026
- Inputs
- The documented binary input may be an executable, object file, dynamic library, or archive.llvm.org · read 5 Oct 2026
- Integrations
- The documentation describes using llvm-profdata to merge raw or indexed profiles and exporting coverage in lcov format.clang.llvm.org · read 5 Oct 2026
- Line reports
- The show command displays line-by-line coverage and can filter results to specified source files.llvm.org · read 5 Oct 2026
- Purpose
- llvm-cov shows code coverage information for programs instrumented to emit profile data.llvm.org · read 5 Oct 2026
- Security
- LLVM says its language frontends, analyzers, optimizers, and code generators are not hardened against malicious input, which can cause arbitrary code execution in LLVM.llvm.org · read 5 Oct 2026
- Summary metrics
- The report command can display coverage summaries, including branch statistics, function coverage, and MC/DC statistics.llvm.org · read 5 Oct 2026
- Workflow
- Coverage requires building an instrumented program, running it to produce profile data, and converting raw profile data with llvm-profdata merge for use by llvm-cov.llvm.org · read 5 Oct 2026