[all-commits] [llvm/llvm-project] dc94eb: [clang][CodeCoverage] Fix CoverageMapping for bina...

David Tellenbach via All-commits all-commits at lists.llvm.org
Sun Feb 18 14:34:47 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dc94eb57e39a925a9672bfc4d7cba0fb0da874d8
      https://github.com/llvm/llvm-project/commit/dc94eb57e39a925a9672bfc4d7cba0fb0da874d8
  Author: David Tellenbach <dtellenbach at apple.com>
  Date:   2024-02-18 (Sun, 18 Feb 2024)

  Changed paths:
    M clang/lib/CodeGen/CoverageMappingGen.cpp
    A clang/test/CoverageMapping/conditional-operator.c

  Log Message:
  -----------
  [clang][CodeCoverage] Fix CoverageMapping for binary conditionals ops (#82141)

Fix an issue that produces a wrong coverage mapping when using binary
conditional operators as show in the example below.

Before this patch:

    1|      1|int binary_cond(int x) {
    2|      1|  x = x ?: 4;
    3|      1|  int y = 0;
    4|      0|  return x;       <-- Not covered
    5|      1|}

After this patch:

    1|      1|int binary_cond(int x) {
    2|      1|  x = x ?: 4;
    3|      1|  int y = 0;
    4|      1|  return x;       <-- Covered
    5|      1|}



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