Files
rust/tests/coverage/branch/while.cov-map
Zalathar f521dd4ed9 Switch over to hybrid HIR-aware coverage spans
Instead of trying to heuristically recover source-code spans from MIR soup, we
can now take advantage of the `CoverageKind::Point` statements injected for
specific HIR expressions.

This is a transitional implementation that lets us remove the old MIR-soup
code, but still relies heavily on the existing span-refinement heuristics, and
does not take advantage of the full possibilities of HIR-aware coverage
instrumentation.

In order to avoid annoying never-executed spans in code that contains
assertions, a heuristic has been added that ignores any expression within the
arguments of a macro-expanded function call that returns `!`.

Some coverage tests now require `//@ min-llvm-version: 23`, due to changes in
how LLVM sorts the coverage mapping entries.
2026-09-06 10:24:48 +10:00

101 lines
5.0 KiB
Plaintext

Function name: while::while_cond
Raw bytes (43): 0x[01, 01, 01, 05, 01, 07, 01, 0c, 01, 00, 10, 01, 01, 05, 00, 0e, 01, 02, 11, 00, 12, 05, 01, 0b, 00, 10, 20, 02, 01, 00, 0b, 00, 10, 02, 01, 09, 00, 0f, 01, 02, 01, 00, 02]
Number of files: 1
- file 0 => $DIR/while.rs
Number of expressions: 1
- expression 0 operands: lhs = Counter(1), rhs = Counter(0)
Number of file 0 mappings: 7
- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 16)
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14)
- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 18)
- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16)
- Branch { true: Expression(0, Sub), false: Counter(0) } at (prev + 0, 11) to (start + 0, 16)
true = (c1 - c0)
false = c0
- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15)
= (c1 - c0)
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
Highest counter ID seen: c1
Function name: while::while_cond_not
Raw bytes (43): 0x[01, 01, 01, 05, 01, 07, 01, 15, 01, 00, 14, 01, 01, 05, 00, 0e, 01, 02, 11, 00, 12, 05, 01, 0b, 00, 14, 20, 02, 01, 00, 0b, 00, 14, 02, 01, 09, 00, 0f, 01, 02, 01, 00, 02]
Number of files: 1
- file 0 => $DIR/while.rs
Number of expressions: 1
- expression 0 operands: lhs = Counter(1), rhs = Counter(0)
Number of file 0 mappings: 7
- Code(Counter(0)) at (prev + 21, 1) to (start + 0, 20)
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14)
- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 18)
- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 20)
- Branch { true: Expression(0, Sub), false: Counter(0) } at (prev + 0, 11) to (start + 0, 20)
true = (c1 - c0)
false = c0
- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15)
= (c1 - c0)
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
Highest counter ID seen: c1
Function name: while::while_op_and
Raw bytes (75): 0x[01, 01, 06, 05, 09, 05, 01, 0f, 05, 01, 09, 05, 01, 05, 01, 0b, 01, 1e, 01, 00, 12, 01, 01, 05, 00, 0e, 01, 02, 11, 00, 12, 01, 01, 11, 00, 12, 05, 01, 0b, 00, 10, 20, 09, 02, 00, 0b, 00, 10, 09, 00, 14, 00, 19, 20, 16, 0a, 00, 14, 00, 19, 16, 01, 09, 00, 0f, 16, 01, 09, 00, 0f, 01, 02, 01, 00, 02]
Number of files: 1
- file 0 => $DIR/while.rs
Number of expressions: 6
- expression 0 operands: lhs = Counter(1), rhs = Counter(2)
- expression 1 operands: lhs = Counter(1), rhs = Counter(0)
- expression 2 operands: lhs = Expression(3, Add), rhs = Counter(1)
- expression 3 operands: lhs = Counter(0), rhs = Counter(2)
- expression 4 operands: lhs = Counter(1), rhs = Counter(0)
- expression 5 operands: lhs = Counter(1), rhs = Counter(0)
Number of file 0 mappings: 11
- Code(Counter(0)) at (prev + 30, 1) to (start + 0, 18)
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14)
- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 18)
- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 18)
- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16)
- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 11) to (start + 0, 16)
true = c2
false = (c1 - c2)
- Code(Counter(2)) at (prev + 0, 20) to (start + 0, 25)
- Branch { true: Expression(5, Sub), false: Expression(2, Sub) } at (prev + 0, 20) to (start + 0, 25)
true = (c1 - c0)
false = ((c0 + c2) - c1)
- Code(Expression(5, Sub)) at (prev + 1, 9) to (start + 0, 15)
= (c1 - c0)
- Code(Expression(5, Sub)) at (prev + 1, 9) to (start + 0, 15)
= (c1 - c0)
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
Highest counter ID seen: c2
Function name: while::while_op_or
Raw bytes (73): 0x[01, 01, 05, 05, 09, 05, 0b, 01, 09, 05, 01, 05, 01, 0b, 01, 29, 01, 00, 11, 01, 01, 05, 00, 0e, 01, 02, 11, 00, 12, 01, 01, 11, 00, 12, 05, 01, 0b, 00, 10, 20, 09, 02, 00, 0b, 00, 10, 02, 00, 14, 00, 19, 20, 06, 01, 00, 14, 00, 19, 12, 01, 09, 00, 0f, 12, 01, 09, 00, 0f, 01, 02, 01, 00, 02]
Number of files: 1
- file 0 => $DIR/while.rs
Number of expressions: 5
- expression 0 operands: lhs = Counter(1), rhs = Counter(2)
- expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add)
- expression 2 operands: lhs = Counter(0), rhs = Counter(2)
- expression 3 operands: lhs = Counter(1), rhs = Counter(0)
- expression 4 operands: lhs = Counter(1), rhs = Counter(0)
Number of file 0 mappings: 11
- Code(Counter(0)) at (prev + 41, 1) to (start + 0, 17)
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14)
- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 18)
- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 18)
- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16)
- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 11) to (start + 0, 16)
true = c2
false = (c1 - c2)
- Code(Expression(0, Sub)) at (prev + 0, 20) to (start + 0, 25)
= (c1 - c2)
- Branch { true: Expression(1, Sub), false: Counter(0) } at (prev + 0, 20) to (start + 0, 25)
true = (c1 - (c0 + c2))
false = c0
- Code(Expression(4, Sub)) at (prev + 1, 9) to (start + 0, 15)
= (c1 - c0)
- Code(Expression(4, Sub)) at (prev + 1, 9) to (start + 0, 15)
= (c1 - c0)
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
Highest counter ID seen: c2