LLVM llvm-cov
llvm.org
What it is
LLVM llvm-cov is a free, self-hosted developer tool for examining coverage in instrumented C, C++, Objective-C, and Objective-C++ programs. It accepts executables, object files, dynamic libraries, or archives and works with gcov-style data or Clang instrumentation-based profiling. Its commands include gcov, show, report, and export. Show provides line-level coverage and can focus on selected source files. Report summarizes measurements such as branch, function, and MC/DC statistics; documented coverage types also include instantiation and region coverage. Output can be text, HTML, JSON, or LCOV. JSON exports may contain regions, functions, branches, expansions, and summaries. A typical workflow builds an instrumented program, runs it to create profile data, then uses llvm-profdata merge before analysis. The gcov command is compatible with gcov from GCC 4.2 and may work with later versions. LLVM documents llvm-cov as part of its developer toolchain. It runs on Linux, macOS, and Windows and has no paid plans or stated usage limits.
Spec sheet
- Purpose
- llvm-cov shows code coverage information for programs instrumented to emit profile data.Read 5 Oct 2026 · llvm.org
- Audience
- The tool is for examining code coverage of instrumented programs; LLVM documents it as part of its developer toolchain.Read 5 Oct 2026 · llvm.org
- Integrations
- The documentation describes using llvm-profdata to merge raw or indexed profiles and exporting coverage in lcov format.Read 5 Oct 2026 · clang.llvm.org
- 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.Read 5 Oct 2026 · llvm.org
- Commands
- The documented commands include gcov, show, report, and export.Read 5 Oct 2026 · llvm.org
- Compatibility
- The gcov subcommand is compatible with gcov from GCC 4.2 and may work with some later gcov versions.Read 5 Oct 2026 · llvm.org
- Coverage modes
- It works with gcov-style coverage or Clang instrumentation-based profiling.Read 5 Oct 2026 · llvm.org
- Downloads
- The LLVM release page says source packages and Git tags are signed by release managers and provides keys for verification.Read 5 Oct 2026 · releases.llvm.org
- Export formats
- Coverage can be exported as JSON or lcov trace format, with regions, functions, branches, expansions, and summaries available in JSON.Read 5 Oct 2026 · llvm.org
- HTML reports
- Clang's source-based coverage guide says llvm-cov can generate HTML reports.Read 5 Oct 2026 · clang.llvm.org
- Inputs
- The documented binary input may be an executable, object file, dynamic library, or archive.Read 5 Oct 2026 · llvm.org
- Line reports
- The show command displays line-by-line coverage and can filter results to specified source files.Read 5 Oct 2026 · llvm.org
- Summary metrics
- The report command can display coverage summaries, including branch statistics, function coverage, and MC/DC statistics.Read 5 Oct 2026 · llvm.org
- 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.Read 5 Oct 2026 · llvm.org
Plans and prices
Strong points and limits
Strong points
- Free open-source LLVM tool
- Runs on Linux, macOS, and Windows
- Supports text, HTML, JSON, and LCOV
- Includes branch and MC/DC statistics
- Accepts several binary input types
Limits
- Requires an instrumented build and profile workflow
- LLVM warns components are not hardened against malicious input
- No graphical platform details beyond documented reports
Who it suits
It suits developers and teams examining coverage from instrumented native-language programs. It is also relevant to users who need command-line reports or exportable coverage data.
Verdict
llvm-cov provides broad coverage analysis and export options for LLVM-based development workflows. Users must prepare instrumentation and profile data before reporting.
Where Specifiction places it
- Test Coverage Tools#17 of 277.5