mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-02 17:44:28 +00:00
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.
26 lines
1.3 KiB
Plaintext
26 lines
1.3 KiB
Plaintext
Function name: simple_loop::main
|
|
Raw bytes (65): 0x[01, 01, 03, 01, 05, 09, 01, 09, 01, 0b, 01, 04, 01, 00, 0a, 01, 04, 13, 00, 2e, 01, 02, 19, 00, 1a, 01, 03, 09, 00, 10, 05, 02, 09, 02, 0f, 02, 04, 05, 00, 06, 09, 05, 0d, 02, 0e, 01, 04, 0d, 00, 12, 0a, 02, 09, 00, 0a, 0a, 01, 09, 02, 0a, 01, 05, 01, 00, 02]
|
|
Number of files: 1
|
|
- file 0 => $DIR/simple_loop.rs
|
|
Number of expressions: 3
|
|
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
|
|
- expression 1 operands: lhs = Counter(2), rhs = Counter(0)
|
|
- expression 2 operands: lhs = Counter(2), rhs = Counter(0)
|
|
Number of file 0 mappings: 11
|
|
- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10)
|
|
- Code(Counter(0)) at (prev + 4, 19) to (start + 0, 46)
|
|
- Code(Counter(0)) at (prev + 2, 25) to (start + 0, 26)
|
|
- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 16)
|
|
- Code(Counter(1)) at (prev + 2, 9) to (start + 2, 15)
|
|
- Code(Expression(0, Sub)) at (prev + 4, 5) to (start + 0, 6)
|
|
= (c0 - c1)
|
|
- Code(Counter(2)) at (prev + 5, 13) to (start + 2, 14)
|
|
- Code(Counter(0)) at (prev + 4, 13) to (start + 0, 18)
|
|
- Code(Expression(2, Sub)) at (prev + 2, 9) to (start + 0, 10)
|
|
= (c2 - c0)
|
|
- Code(Expression(2, Sub)) at (prev + 1, 9) to (start + 2, 10)
|
|
= (c2 - c0)
|
|
- Code(Counter(0)) at (prev + 5, 1) to (start + 0, 2)
|
|
Highest counter ID seen: c2
|
|
|