Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
coverage: Shrink call spans to just the function name
This is a way to shrink call spans that doesn't involve mixing different spans,
and avoids overlap with argument spans.

This patch also removes some low-value comments that were causing rustfmt to
ignore the match arms.
  • Loading branch information
Zalathar committed Apr 1, 2025
commit 577272eedeaace00aa695135b3b8fee3768536a5
18 changes: 7 additions & 11 deletions compiler/rustc_mir_transform/src/coverage/spans/from_mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,20 @@ fn filtered_terminator_span(terminator: &Terminator<'_>) -> Option<Span> {
// an `if condition { block }` has a span that includes the executed block, if true,
// but for coverage, the code region executed, up to *and* through the SwitchInt,
// actually stops before the if's block.)
TerminatorKind::Unreachable // Unreachable blocks are not connected to the MIR CFG
TerminatorKind::Unreachable
| TerminatorKind::Assert { .. }
| TerminatorKind::Drop { .. }
| TerminatorKind::SwitchInt { .. }
// For `FalseEdge`, only the `real` branch is taken, so it is similar to a `Goto`.
| TerminatorKind::FalseEdge { .. }
| TerminatorKind::Goto { .. } => None,

// Call `func` operand can have a more specific span when part of a chain of calls
TerminatorKind::Call { ref func, .. }
| TerminatorKind::TailCall { ref func, .. } => {
TerminatorKind::Call { ref func, .. } | TerminatorKind::TailCall { ref func, .. } => {
let mut span = terminator.source_info.span;
if let mir::Operand::Constant(box constant) = func {
if constant.span.lo() > span.lo() {
span = span.with_lo(constant.span.lo());
}
if let mir::Operand::Constant(constant) = func
&& span.contains(constant.span)
{
span = constant.span;
}
Comment on lines -135 to 137
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this to method calls?

And wouldn't you also make this work in case of let x = func; x(foo); to point at the x part of the function call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original version of this heuristic predates me, but I think the intention was to deal with chained calls like this:

    data.foo().bar().baz(args);
//  ^^^^^^^^^^^^^^^^^^^^^^^^^^ (original span of the MIR call to baz)
//                   ^^^^^^^^^ (modified call span before this PR)
//                   ^^^       (modified call span after this PR)

In practice, a lot of these small differences are hard to observe in the output, because there's a subsequent step that merges nearby spans that are considered to have the same control-flow for coverage purposes.

(This merging even happens for non-adjacent/overlapping spans in some cases, which is a behaviour I would eventually like to get rid of.)

Copy link
Contributor Author

@Zalathar Zalathar Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, I don't know the original reason for restricting this heuristic to “constant” function/method names, but I suspect it comes down to the fact that evaluating a non-constant callee can potentially have its own internal control flow, which can potentially result in confusing spans.

That said, such code is (a) relatively uncommon in practice, and (b) will probably cause the current span-refinement code to just discard the whole call span.

So I guess my reason for not changing it in this PR is to mostly just to avoid changes beyond my intended scope.

Some(span)
}
Expand All @@ -147,9 +145,7 @@ fn filtered_terminator_span(terminator: &Terminator<'_>) -> Option<Span> {
| TerminatorKind::Yield { .. }
| TerminatorKind::CoroutineDrop
| TerminatorKind::FalseUnwind { .. }
| TerminatorKind::InlineAsm { .. } => {
Some(terminator.source_info.span)
}
| TerminatorKind::InlineAsm { .. } => Some(terminator.source_info.span),
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/coverage/assert-ne.cov-map
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Function name: assert_ne::main
Raw bytes (28): 0x[01, 01, 02, 01, 05, 01, 09, 04, 01, 08, 01, 03, 1c, 05, 04, 0d, 00, 13, 02, 02, 0d, 00, 13, 06, 03, 05, 01, 02]
Raw bytes (28): 0x[01, 01, 02, 01, 05, 01, 09, 04, 01, 08, 01, 03, 15, 05, 04, 0d, 00, 13, 02, 02, 0d, 00, 13, 06, 03, 05, 01, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
- expression 1 operands: lhs = Counter(0), rhs = Counter(2)
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 8, 1) to (start + 3, 28)
- Code(Counter(0)) at (prev + 8, 1) to (start + 3, 21)
- Code(Counter(1)) at (prev + 4, 13) to (start + 0, 19)
- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 19)
= (c0 - c1)
Expand Down
12 changes: 6 additions & 6 deletions tests/coverage/attr/off-on-sandwich.cov-map
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
Function name: off_on_sandwich::dense_a::dense_b
Raw bytes (14): 0x[01, 01, 00, 02, 01, 10, 05, 02, 12, 01, 07, 05, 00, 06]
Raw bytes (14): 0x[01, 01, 00, 02, 01, 10, 05, 02, 10, 01, 07, 05, 00, 06]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 2
- Code(Counter(0)) at (prev + 16, 5) to (start + 2, 18)
- Code(Counter(0)) at (prev + 16, 5) to (start + 2, 16)
- Code(Counter(0)) at (prev + 7, 5) to (start + 0, 6)
Highest counter ID seen: c0

Function name: off_on_sandwich::sparse_a::sparse_b::sparse_c
Raw bytes (14): 0x[01, 01, 00, 02, 01, 22, 09, 02, 17, 01, 0b, 09, 00, 0a]
Raw bytes (14): 0x[01, 01, 00, 02, 01, 22, 09, 02, 15, 01, 0b, 09, 00, 0a]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 2
- Code(Counter(0)) at (prev + 34, 9) to (start + 2, 23)
- Code(Counter(0)) at (prev + 34, 9) to (start + 2, 21)
- Code(Counter(0)) at (prev + 11, 9) to (start + 0, 10)
Highest counter ID seen: c0

Function name: off_on_sandwich::sparse_a::sparse_b::sparse_c::sparse_d
Raw bytes (14): 0x[01, 01, 00, 02, 01, 25, 0d, 02, 1b, 01, 07, 0d, 00, 0e]
Raw bytes (14): 0x[01, 01, 00, 02, 01, 25, 0d, 02, 19, 01, 07, 0d, 00, 0e]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 2
- Code(Counter(0)) at (prev + 37, 13) to (start + 2, 27)
- Code(Counter(0)) at (prev + 37, 13) to (start + 2, 25)
- Code(Counter(0)) at (prev + 7, 13) to (start + 0, 14)
Highest counter ID seen: c0

4 changes: 2 additions & 2 deletions tests/coverage/branch/if.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Number of file 0 mappings: 8
Highest counter ID seen: c2

Function name: if::branch_not
Raw bytes (116): 0x[01, 01, 07, 01, 05, 01, 09, 01, 09, 01, 0d, 01, 0d, 01, 11, 01, 11, 12, 01, 0c, 01, 01, 10, 01, 03, 08, 00, 09, 20, 05, 02, 00, 08, 00, 09, 05, 01, 09, 00, 11, 02, 01, 05, 00, 06, 01, 01, 08, 00, 0a, 20, 0a, 09, 00, 08, 00, 0a, 0a, 00, 0b, 02, 06, 09, 02, 05, 00, 06, 01, 01, 08, 00, 0b, 20, 0d, 12, 00, 08, 00, 0b, 0d, 00, 0c, 02, 06, 12, 02, 05, 00, 06, 01, 01, 08, 00, 0c, 20, 1a, 11, 00, 08, 00, 0c, 1a, 00, 0d, 02, 06, 11, 02, 05, 00, 06, 01, 01, 01, 00, 02]
Raw bytes (116): 0x[01, 01, 07, 01, 05, 01, 09, 01, 09, 01, 0d, 01, 0d, 01, 11, 01, 11, 12, 01, 0c, 01, 01, 10, 01, 03, 08, 00, 09, 20, 05, 02, 00, 08, 00, 09, 05, 01, 09, 00, 10, 02, 01, 05, 00, 06, 01, 01, 08, 00, 0a, 20, 0a, 09, 00, 08, 00, 0a, 0a, 00, 0b, 02, 06, 09, 02, 05, 00, 06, 01, 01, 08, 00, 0b, 20, 0d, 12, 00, 08, 00, 0b, 0d, 00, 0c, 02, 06, 12, 02, 05, 00, 06, 01, 01, 08, 00, 0c, 20, 1a, 11, 00, 08, 00, 0c, 1a, 00, 0d, 02, 06, 11, 02, 05, 00, 06, 01, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 7
Expand All @@ -40,7 +40,7 @@ Number of file 0 mappings: 18
- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 9)
true = c1
false = (c0 - c1)
- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17)
- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 16)
- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6)
= (c0 - c1)
- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 10)
Expand Down
8 changes: 4 additions & 4 deletions tests/coverage/branch/lazy-boolean.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Number of file 0 mappings: 6
Highest counter ID seen: c1

Function name: lazy_boolean::chain
Raw bytes (141): 0x[01, 01, 0f, 01, 05, 05, 09, 09, 0d, 01, 11, 01, 11, 01, 3b, 11, 15, 01, 3b, 11, 15, 01, 37, 3b, 19, 11, 15, 01, 37, 3b, 19, 11, 15, 13, 01, 24, 01, 01, 10, 01, 04, 09, 00, 0a, 01, 00, 0d, 00, 12, 20, 05, 02, 00, 0d, 00, 12, 05, 00, 16, 00, 1b, 20, 09, 06, 00, 16, 00, 1b, 09, 00, 1f, 00, 24, 20, 0d, 0a, 00, 1f, 00, 24, 0d, 00, 28, 00, 2d, 01, 01, 05, 00, 11, 01, 03, 09, 00, 0a, 01, 00, 0d, 00, 12, 20, 11, 12, 00, 0d, 00, 12, 12, 00, 16, 00, 1b, 20, 15, 1e, 00, 16, 00, 1b, 1e, 00, 1f, 00, 24, 20, 19, 32, 00, 1f, 00, 24, 32, 00, 28, 00, 2d, 01, 01, 05, 01, 02]
Raw bytes (141): 0x[01, 01, 0f, 01, 05, 05, 09, 09, 0d, 01, 11, 01, 11, 01, 3b, 11, 15, 01, 3b, 11, 15, 01, 37, 3b, 19, 11, 15, 01, 37, 3b, 19, 11, 15, 13, 01, 24, 01, 01, 10, 01, 04, 09, 00, 0a, 01, 00, 0d, 00, 12, 20, 05, 02, 00, 0d, 00, 12, 05, 00, 16, 00, 1b, 20, 09, 06, 00, 16, 00, 1b, 09, 00, 1f, 00, 24, 20, 0d, 0a, 00, 1f, 00, 24, 0d, 00, 28, 00, 2d, 01, 01, 05, 00, 10, 01, 03, 09, 00, 0a, 01, 00, 0d, 00, 12, 20, 11, 12, 00, 0d, 00, 12, 12, 00, 16, 00, 1b, 20, 15, 1e, 00, 16, 00, 1b, 1e, 00, 1f, 00, 24, 20, 19, 32, 00, 1f, 00, 24, 32, 00, 28, 00, 2d, 01, 01, 05, 01, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 15
Expand Down Expand Up @@ -69,7 +69,7 @@ Number of file 0 mappings: 19
true = c3
false = (c2 - c3)
- Code(Counter(3)) at (prev + 0, 40) to (start + 0, 45)
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17)
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 16)
- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10)
- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 18)
- Branch { true: Counter(4), false: Expression(4, Sub) } at (prev + 0, 13) to (start + 0, 18)
Expand All @@ -91,7 +91,7 @@ Number of file 0 mappings: 19
Highest counter ID seen: c6

Function name: lazy_boolean::nested_mixed
Raw bytes (137): 0x[01, 01, 0d, 01, 05, 01, 1f, 05, 09, 05, 09, 1f, 0d, 05, 09, 1f, 0d, 05, 09, 01, 11, 11, 15, 01, 15, 01, 33, 15, 19, 13, 01, 31, 01, 01, 10, 01, 04, 09, 00, 0a, 01, 00, 0e, 00, 13, 20, 05, 02, 00, 0e, 00, 13, 02, 00, 17, 00, 1d, 20, 09, 06, 00, 17, 00, 1d, 1f, 00, 23, 00, 28, 20, 0d, 1a, 00, 23, 00, 28, 1a, 00, 2c, 00, 33, 01, 01, 05, 00, 11, 01, 03, 09, 00, 0a, 01, 00, 0e, 00, 13, 20, 11, 22, 00, 0e, 00, 13, 11, 00, 17, 00, 1c, 20, 15, 26, 00, 17, 00, 1c, 2a, 00, 22, 00, 28, 20, 19, 2e, 00, 22, 00, 28, 19, 00, 2c, 00, 33, 01, 01, 05, 01, 02]
Raw bytes (137): 0x[01, 01, 0d, 01, 05, 01, 1f, 05, 09, 05, 09, 1f, 0d, 05, 09, 1f, 0d, 05, 09, 01, 11, 11, 15, 01, 15, 01, 33, 15, 19, 13, 01, 31, 01, 01, 10, 01, 04, 09, 00, 0a, 01, 00, 0e, 00, 13, 20, 05, 02, 00, 0e, 00, 13, 02, 00, 17, 00, 1d, 20, 09, 06, 00, 17, 00, 1d, 1f, 00, 23, 00, 28, 20, 0d, 1a, 00, 23, 00, 28, 1a, 00, 2c, 00, 33, 01, 01, 05, 00, 10, 01, 03, 09, 00, 0a, 01, 00, 0e, 00, 13, 20, 11, 22, 00, 0e, 00, 13, 11, 00, 17, 00, 1c, 20, 15, 26, 00, 17, 00, 1c, 2a, 00, 22, 00, 28, 20, 19, 2e, 00, 22, 00, 28, 19, 00, 2c, 00, 33, 01, 01, 05, 01, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 13
Expand Down Expand Up @@ -127,7 +127,7 @@ Number of file 0 mappings: 19
false = ((c1 + c2) - c3)
- Code(Expression(6, Sub)) at (prev + 0, 44) to (start + 0, 51)
= ((c1 + c2) - c3)
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17)
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 16)
- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10)
- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 19)
- Branch { true: Counter(4), false: Expression(8, Sub) } at (prev + 0, 14) to (start + 0, 19)
Expand Down
4 changes: 2 additions & 2 deletions tests/coverage/branch/let-else.cov-map
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Function name: let_else::let_else
Raw bytes (43): 0x[01, 01, 01, 01, 05, 07, 01, 0c, 01, 01, 10, 20, 02, 05, 03, 09, 00, 10, 02, 00, 0e, 00, 0f, 01, 00, 13, 00, 18, 05, 01, 09, 01, 0f, 02, 04, 05, 00, 0b, 01, 01, 01, 00, 02]
Raw bytes (43): 0x[01, 01, 01, 01, 05, 07, 01, 0c, 01, 01, 10, 20, 02, 05, 03, 09, 00, 10, 02, 00, 0e, 00, 0f, 01, 00, 13, 00, 18, 05, 01, 09, 01, 0f, 02, 04, 05, 00, 0a, 01, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 1
Expand All @@ -13,7 +13,7 @@ Number of file 0 mappings: 7
= (c0 - c1)
- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 24)
- Code(Counter(1)) at (prev + 1, 9) to (start + 1, 15)
- Code(Expression(0, Sub)) at (prev + 4, 5) to (start + 0, 11)
- Code(Expression(0, Sub)) at (prev + 4, 5) to (start + 0, 10)
= (c0 - c1)
- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
Highest counter ID seen: c1
Expand Down
28 changes: 14 additions & 14 deletions tests/coverage/branch/match-arms.cov-map
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Function name: match_arms::guards
Raw bytes (88): 0x[01, 01, 08, 15, 05, 19, 09, 1d, 0d, 21, 11, 01, 17, 1b, 11, 1f, 0d, 05, 09, 0c, 01, 30, 01, 01, 10, 21, 03, 0b, 00, 10, 05, 01, 11, 00, 29, 20, 05, 02, 00, 17, 00, 1b, 09, 01, 11, 00, 29, 20, 09, 06, 00, 17, 00, 1b, 0d, 01, 11, 00, 29, 20, 0d, 0a, 00, 17, 00, 1b, 11, 01, 11, 00, 29, 20, 11, 0e, 00, 17, 00, 1b, 12, 01, 0e, 00, 18, 01, 03, 05, 01, 02]
Raw bytes (88): 0x[01, 01, 08, 15, 05, 19, 09, 1d, 0d, 21, 11, 01, 17, 1b, 11, 1f, 0d, 05, 09, 0c, 01, 30, 01, 01, 10, 21, 03, 0b, 00, 10, 05, 01, 11, 00, 28, 20, 05, 02, 00, 17, 00, 1b, 09, 01, 11, 00, 28, 20, 09, 06, 00, 17, 00, 1b, 0d, 01, 11, 00, 28, 20, 0d, 0a, 00, 17, 00, 1b, 11, 01, 11, 00, 28, 20, 11, 0e, 00, 17, 00, 1b, 12, 01, 0e, 00, 15, 01, 03, 05, 01, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 8
Expand All @@ -14,29 +14,29 @@ Number of expressions: 8
Number of file 0 mappings: 12
- Code(Counter(0)) at (prev + 48, 1) to (start + 1, 16)
- Code(Counter(8)) at (prev + 3, 11) to (start + 0, 16)
- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 41)
- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 40)
- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 23) to (start + 0, 27)
true = c1
false = (c5 - c1)
- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 41)
- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 40)
- Branch { true: Counter(2), false: Expression(1, Sub) } at (prev + 0, 23) to (start + 0, 27)
true = c2
false = (c6 - c2)
- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 41)
- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 40)
- Branch { true: Counter(3), false: Expression(2, Sub) } at (prev + 0, 23) to (start + 0, 27)
true = c3
false = (c7 - c3)
- Code(Counter(4)) at (prev + 1, 17) to (start + 0, 41)
- Code(Counter(4)) at (prev + 1, 17) to (start + 0, 40)
- Branch { true: Counter(4), false: Expression(3, Sub) } at (prev + 0, 23) to (start + 0, 27)
true = c4
false = (c8 - c4)
- Code(Expression(4, Sub)) at (prev + 1, 14) to (start + 0, 24)
- Code(Expression(4, Sub)) at (prev + 1, 14) to (start + 0, 21)
= (c0 - (((c1 + c2) + c3) + c4))
- Code(Counter(0)) at (prev + 3, 5) to (start + 1, 2)
Highest counter ID seen: c8

Function name: match_arms::match_arms
Raw bytes (45): 0x[01, 01, 03, 01, 07, 0b, 0d, 05, 09, 07, 01, 18, 01, 01, 10, 01, 03, 0b, 00, 10, 05, 01, 11, 00, 21, 09, 01, 11, 00, 21, 0d, 01, 11, 00, 21, 02, 01, 11, 00, 21, 01, 03, 05, 01, 02]
Raw bytes (45): 0x[01, 01, 03, 01, 07, 0b, 0d, 05, 09, 07, 01, 18, 01, 01, 10, 01, 03, 0b, 00, 10, 05, 01, 11, 00, 20, 09, 01, 11, 00, 20, 0d, 01, 11, 00, 20, 02, 01, 11, 00, 20, 01, 03, 05, 01, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 3
Expand All @@ -46,16 +46,16 @@ Number of expressions: 3
Number of file 0 mappings: 7
- Code(Counter(0)) at (prev + 24, 1) to (start + 1, 16)
- Code(Counter(0)) at (prev + 3, 11) to (start + 0, 16)
- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 33)
- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 33)
- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 33)
- Code(Expression(0, Sub)) at (prev + 1, 17) to (start + 0, 33)
- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 32)
- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 32)
- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 32)
- Code(Expression(0, Sub)) at (prev + 1, 17) to (start + 0, 32)
= (c0 - ((c1 + c2) + c3))
- Code(Counter(0)) at (prev + 3, 5) to (start + 1, 2)
Highest counter ID seen: c3

Function name: match_arms::or_patterns
Raw bytes (57): 0x[01, 01, 04, 05, 09, 01, 0b, 03, 0d, 01, 03, 09, 01, 25, 01, 01, 10, 01, 03, 0b, 00, 10, 05, 01, 11, 00, 12, 09, 00, 1e, 00, 1f, 03, 00, 24, 00, 2e, 0d, 01, 11, 00, 12, 06, 00, 1e, 00, 1f, 0e, 00, 24, 00, 2e, 01, 03, 05, 01, 02]
Raw bytes (57): 0x[01, 01, 04, 05, 09, 01, 0b, 03, 0d, 01, 03, 09, 01, 25, 01, 01, 10, 01, 03, 0b, 00, 10, 05, 01, 11, 00, 12, 09, 00, 1e, 00, 1f, 03, 00, 24, 00, 2d, 0d, 01, 11, 00, 12, 06, 00, 1e, 00, 1f, 0e, 00, 24, 00, 2d, 01, 03, 05, 01, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 4
Expand All @@ -68,12 +68,12 @@ Number of file 0 mappings: 9
- Code(Counter(0)) at (prev + 3, 11) to (start + 0, 16)
- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 18)
- Code(Counter(2)) at (prev + 0, 30) to (start + 0, 31)
- Code(Expression(0, Add)) at (prev + 0, 36) to (start + 0, 46)
- Code(Expression(0, Add)) at (prev + 0, 36) to (start + 0, 45)
= (c1 + c2)
- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 18)
- Code(Expression(1, Sub)) at (prev + 0, 30) to (start + 0, 31)
= (c0 - ((c1 + c2) + c3))
- Code(Expression(3, Sub)) at (prev + 0, 36) to (start + 0, 46)
- Code(Expression(3, Sub)) at (prev + 0, 36) to (start + 0, 45)
= (c0 - (c1 + c2))
- Code(Counter(0)) at (prev + 3, 5) to (start + 1, 2)
Highest counter ID seen: c3
Expand Down
10 changes: 6 additions & 4 deletions tests/coverage/condition/conditions.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,17 @@ Number of file 0 mappings: 1
Highest counter ID seen: c0

Function name: conditions::func_call
Raw bytes (37): 0x[01, 01, 02, 01, 05, 05, 09, 05, 01, 25, 01, 01, 0a, 20, 05, 02, 01, 09, 00, 0a, 05, 00, 0e, 00, 0f, 20, 09, 06, 00, 0e, 00, 0f, 01, 01, 01, 00, 02]
Raw bytes (47): 0x[01, 01, 02, 01, 05, 05, 09, 07, 01, 25, 01, 00, 20, 01, 01, 05, 00, 08, 01, 00, 09, 00, 0a, 20, 05, 02, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 20, 09, 06, 00, 0e, 00, 0f, 01, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
Number of file 0 mappings: 5
- Code(Counter(0)) at (prev + 37, 1) to (start + 1, 10)
- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 1, 9) to (start + 0, 10)
Number of file 0 mappings: 7
- Code(Counter(0)) at (prev + 37, 1) to (start + 0, 32)
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 8)
- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 10)
- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 9) to (start + 0, 10)
true = c1
false = (c0 - c1)
- Code(Counter(1)) at (prev + 0, 14) to (start + 0, 15)
Expand Down
4 changes: 2 additions & 2 deletions tests/coverage/coroutine.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ Number of file 0 mappings: 4
Highest counter ID seen: c1

Function name: coroutine::main
Raw bytes (53): 0x[01, 01, 02, 01, 05, 05, 09, 09, 01, 13, 01, 02, 16, 01, 08, 0b, 00, 2e, 05, 01, 2b, 00, 2d, 02, 01, 0e, 00, 35, 05, 02, 0b, 00, 2e, 0d, 01, 22, 00, 27, 09, 00, 2c, 00, 2e, 06, 01, 0e, 00, 35, 09, 02, 01, 00, 02]
Raw bytes (53): 0x[01, 01, 02, 01, 05, 05, 09, 09, 01, 13, 01, 02, 16, 01, 08, 0b, 00, 2d, 05, 01, 2b, 00, 2d, 02, 01, 0e, 00, 35, 05, 02, 0b, 00, 2e, 0d, 01, 22, 00, 27, 09, 00, 2c, 00, 2e, 06, 01, 0e, 00, 35, 09, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
Number of file 0 mappings: 9
- Code(Counter(0)) at (prev + 19, 1) to (start + 2, 22)
- Code(Counter(0)) at (prev + 8, 11) to (start + 0, 46)
- Code(Counter(0)) at (prev + 8, 11) to (start + 0, 45)
- Code(Counter(1)) at (prev + 1, 43) to (start + 0, 45)
- Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 53)
= (c0 - c1)
Expand Down
18 changes: 9 additions & 9 deletions tests/coverage/holes.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ Number of file 0 mappings: 1
Highest counter ID seen: (none)

Function name: holes::main
Raw bytes (69): 0x[01, 01, 00, 0d, 01, 08, 01, 01, 12, 01, 05, 05, 00, 12, 01, 07, 09, 00, 11, 01, 09, 05, 00, 12, 01, 04, 05, 00, 12, 01, 07, 05, 00, 12, 01, 06, 05, 00, 12, 01, 04, 05, 00, 12, 01, 04, 05, 00, 12, 01, 06, 05, 03, 0f, 01, 0a, 05, 03, 0f, 01, 0a, 05, 0c, 0d, 01, 0f, 0e, 05, 02]
Raw bytes (69): 0x[01, 01, 00, 0d, 01, 08, 01, 01, 11, 01, 05, 05, 00, 11, 01, 07, 09, 00, 11, 01, 09, 05, 00, 11, 01, 04, 05, 00, 11, 01, 07, 05, 00, 11, 01, 06, 05, 00, 11, 01, 04, 05, 00, 11, 01, 04, 05, 00, 11, 01, 06, 05, 03, 0f, 01, 0a, 05, 03, 0f, 01, 0a, 05, 0c, 0d, 01, 0f, 0e, 05, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 13
- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 18)
- Code(Counter(0)) at (prev + 5, 5) to (start + 0, 18)
- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 17)
- Code(Counter(0)) at (prev + 5, 5) to (start + 0, 17)
- Code(Counter(0)) at (prev + 7, 9) to (start + 0, 17)
- Code(Counter(0)) at (prev + 9, 5) to (start + 0, 18)
- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 18)
- Code(Counter(0)) at (prev + 7, 5) to (start + 0, 18)
- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 18)
- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 18)
- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 18)
- Code(Counter(0)) at (prev + 9, 5) to (start + 0, 17)
- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 17)
- Code(Counter(0)) at (prev + 7, 5) to (start + 0, 17)
- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 17)
- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 17)
- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 17)
- Code(Counter(0)) at (prev + 6, 5) to (start + 3, 15)
- Code(Counter(0)) at (prev + 10, 5) to (start + 3, 15)
- Code(Counter(0)) at (prev + 10, 5) to (start + 12, 13)
Expand Down
Loading