[all-commits] [llvm/llvm-project] 025639: [Coverage] Fix mapping for do-while loops with ter...

Justin Cady via All-commits all-commits at lists.llvm.org
Mon May 19 12:49:47 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 025639bc396f1e0d2ead279c5f345cb381733f16
      https://github.com/llvm/llvm-project/commit/025639bc396f1e0d2ead279c5f345cb381733f16
  Author: Justin Cady <desk at justincady.com>
  Date:   2025-05-19 (Mon, 19 May 2025)

  Changed paths:
    M clang/lib/CodeGen/CoverageMappingGen.cpp
    M clang/test/CoverageMapping/terminate-statements.cpp
    A compiler-rt/test/profile/Linux/coverage-do-while.c

  Log Message:
  -----------
  [Coverage] Fix mapping for do-while loops with terminating statements (#139777)

The current region mapping for do-while loops that contain statements
such as break or continue results in inaccurate line coverage reports
for the line following the loop.

This change handles terminating statements the same way that other loop
constructs do, correcting the region mapping for accurate reports. It
also fixes a fragile test relying on exact line numbers.

Fixes #139122



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list