Freedom251 › Test Coverage Tools
LLVM llvm-cov

What LLVM llvm-cov is
LLVM llvm-cov is a developer tool for examining coverage in programs built to produce profile data. It supports gcov-style coverage and Clang instrumentation-based profiling, with coverage types including function, instantiation, line, region, branch, and MC/DC. Its commands include gcov, show, report, and export. The show command presents coverage by source line and can filter results to selected source files. The report command can summarize coverage, including branch, function, and MC/DC statistics. Reports can be produced as text, HTML, JSON, or LCOV; JSON can include regions, functions, branches, expansions, and summaries. Inputs may be executables, object files, dynamic libraries, or archives. Using llvm-cov requires building an instrumented program, running it to create profile data, then processing raw data with llvm-profdata merge. It is free, with no paid plan or usage limits stated, and is available for Linux, macOS, and Windows. LLVM warns that its language frontends, analyzers, optimizers, and code generators are not hardened against malicious input.
Who it suits
It suits developers examining coverage for instrumented C, C++, Objective-C, or Objective-C++ programs. Teams that need line-level views or summary exports can use its reporting commands.
What it does well
- Supports line, branch, function, region, and MC/DC coverage.
- Can produce text, HTML, JSON, and LCOV reports.
- Accepts executables, object files, libraries, and archives.
- Available for Linux, macOS, and Windows.
What to know first
- Requires an instrumented build and generated profile data.
- LLVM warns its compiler components are not hardened against malicious input.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| LLVM llvm-cov | Open source LLVM tool; no paid plans or usage limits stated | Free |
As llvm.org lists them, read 5 Oct 2026. The maker's own page has the final word.
Getting started
- Open the LLVM llvm-cov documentation.
- Build an instrumented program.
- Run the program to produce profile data.
- Use llvm-profdata merge to prepare raw profile data.
- Run llvm-cov with the resulting profile data and a supported binary input.
Verdict
llvm-cov provides several coverage views and export formats for instrumented programs. Its workflow requires profile data, and LLVM's warning about malicious inputs is relevant when handling untrusted code.
Questions
How much does LLVM llvm-cov cost?
It is free, with a listed price of $0 plan.
Which platforms does LLVM llvm-cov support?
Linux, macOS, and Windows.
Which report formats are available?
Text, HTML, JSON, and LCOV.
Which programming languages are covered?
C, C++, Objective-C, and Objective-C++.
Is LLVM llvm-cov open source?
Yes. It is an open source LLVM tool.
What data does it need to produce coverage?
It uses profile data from an instrumented program. Raw data can be merged with llvm-profdata before use.
Facts from LLVM llvm-cov's own pages
- Audience
- The tool is for examining code coverage of instrumented programs; LLVM documents it as part of its developer toolchain. · llvm.org, 5 Oct 2026
- Commands
- The documented commands include gcov, show, report, and export. · llvm.org, 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, 5 Oct 2026
- Coverage modes
- It works with gcov-style coverage or Clang instrumentation-based profiling. · llvm.org, 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, 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, 5 Oct 2026
- HTML reports
- Clang's source-based coverage guide says llvm-cov can generate HTML reports. · clang.llvm.org, 5 Oct 2026
- Inputs
- The documented binary input may be an executable, object file, dynamic library, or archive. · llvm.org, 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, 5 Oct 2026
- Line reports
- The show command displays line-by-line coverage and can filter results to specified source files. · llvm.org, 5 Oct 2026
- Purpose
- llvm-cov shows code coverage information for programs instrumented to emit profile data. · llvm.org, 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, 5 Oct 2026
- Summary metrics
- The report command can display coverage summaries, including branch statistics, function coverage, and MC/DC statistics. · llvm.org, 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, 5 Oct 2026
Where LLVM llvm-cov stands on Freedom251
- Test Coverage Tools#12 of 27