rust/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff
Zalathar 577272eede 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.
2025-04-01 13:07:33 +11:00

53 lines
1.3 KiB
Diff

- // MIR for `main` before InstrumentCoverage
+ // MIR for `main` after InstrumentCoverage
fn main() -> () {
let mut _0: ();
let mut _1: ();
let mut _2: bool;
let mut _3: !;
+ coverage Code { bcb: bcb0 } => $DIR/instrument_coverage.rs:13:1: 13:11 (#0);
+ coverage Code { bcb: bcb1 } => $DIR/instrument_coverage.rs:15:12: 15:15 (#0);
+ coverage Code { bcb: bcb2 } => $DIR/instrument_coverage.rs:16:13: 16:18 (#0);
+ coverage Code { bcb: bcb3 } => $DIR/instrument_coverage.rs:17:10: 17:10 (#0);
+ coverage Code { bcb: bcb2 } => $DIR/instrument_coverage.rs:19:2: 19:2 (#0);
+
bb0: {
+ Coverage::VirtualCounter(bcb0);
goto -> bb1;
}
bb1: {
+ Coverage::VirtualCounter(bcb1);
falseUnwind -> [real: bb2, unwind: bb6];
}
bb2: {
StorageLive(_2);
_2 = bar() -> [return: bb3, unwind: bb6];
}
bb3: {
switchInt(move _2) -> [0: bb5, otherwise: bb4];
}
bb4: {
+ Coverage::VirtualCounter(bcb2);
_0 = const ();
StorageDead(_2);
return;
}
bb5: {
+ Coverage::VirtualCounter(bcb3);
_1 = const ();
StorageDead(_2);
goto -> bb1;
}
bb6 (cleanup): {
resume;
}
}