[llvm] [llvm-dwarfdump][LineCov] Add --variable-coverage-maybe-undefined option (PR #220855)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 15 04:55:23 PDT 2026
================
@@ -53,10 +72,49 @@ RUN: llvm-dwarfdump --show-variable-coverage --variable-coverage-bitcode-file=%S
BASELINE-BITCODE: Variable coverage statistics:
BASELINE-BITCODE-NEXT: Function InlChain Variable Decl LinesCovered Baseline CoveredRatio LinesPresent LinesPresentRatio
-BASELINE-BITCODE-NEXT: f k test.c:20 2 2 1 2 1
-BASELINE-BITCODE-NEXT: f l test.c:20 3 3 1 3 1
+BASELINE-BITCODE-NEXT: f k test.c:35 3 3 1 3 1
+BASELINE-BITCODE-NEXT: f l test.c:35 4 4 1 4 1
+BASELINE-BITCODE-NEXT: fn0 a test.c:21 1 2 0.5 1 0.5
+BASELINE-BITCODE-NEXT: fn0 u test.c:20 5 10 0.5 5 0.5
+BASELINE-BITCODE-NEXT: fn0 v test.c:27 0 1 0 0 0
+BASELINE-BITCODE-NEXT: fn0 x test.c:19 6 11 0.545 6 0.545
+BASELINE-BITCODE-NEXT: fn0 y test.c:19 6 11 0.545 6 0.545
BASELINE-BITCODE-NEXT: fn1 a test.c:11 3 6 0.5 3 0.5
BASELINE-BITCODE-NEXT: fn1 u test.c:4 1 12 0.0833 5 0.417
BASELINE-BITCODE-NEXT: fn1 v test.c:13 0 4 0 2 0.5
BASELINE-BITCODE-NEXT: fn1 x test.c:3 6 13 0.462 6 0.462
BASELINE-BITCODE-NEXT: fn1 y test.c:3 6 13 0.462 6 0.462
+
+RUN: llvm-dwarfdump --show-variable-coverage --variable-coverage-maybe-undefined --variable-coverage-bitcode-file=%S/Inputs/coverage.ll %t.o | FileCheck %s --check-prefix=MAYBE-UNDEFINED
+
+MAYBE-UNDEFINED: Variable coverage statistics:
+MAYBE-UNDEFINED-NEXT: Function InlChain Variable Decl LinesCovered
+MAYBE-UNDEFINED-NEXT: f k test.c:35 3
+MAYBE-UNDEFINED-NEXT: f l test.c:35 4
+MAYBE-UNDEFINED-NEXT: fn0 a test.c:21 5
+MAYBE-UNDEFINED-NEXT: fn0 u test.c:20 10
+MAYBE-UNDEFINED-NEXT: fn0 v test.c:27 1
+MAYBE-UNDEFINED-NEXT: fn0 x test.c:19 11
+MAYBE-UNDEFINED-NEXT: fn0 y test.c:19 11
+MAYBE-UNDEFINED-NEXT: fn1 a test.c:11 6
+MAYBE-UNDEFINED-NEXT: fn1 u test.c:4 12
+MAYBE-UNDEFINED-NEXT: fn1 v test.c:13 4
+MAYBE-UNDEFINED-NEXT: fn1 x test.c:3 13
+MAYBE-UNDEFINED-NEXT: fn1 y test.c:3 13
+
+RUN: llvm-dwarfdump --show-variable-coverage --variable-coverage-maybe-undefined --variable-coverage-bitcode-file=%S/Inputs/coverage.ll --coverage-baseline %t.o %t-opt.o | FileCheck %s --check-prefix=MAYBE-UNDEFINED-BASELINE
+
+MAYBE-UNDEFINED-BASELINE: Variable coverage statistics:
+MAYBE-UNDEFINED-BASELINE-NEXT: Function InlChain Variable Decl LinesCovered
----------------
SLTozer wrote:
Should include the full header (it's useful for test readability)
https://github.com/llvm/llvm-project/pull/220855
More information about the llvm-commits
mailing list