From c45ee4bb29000cc0d02b11afa682852b5174b8a5 Mon Sep 17 00:00:00 2001 From: Rich Kadel Date: Mon, 16 Nov 2020 09:14:28 -0800 Subject: Coverage tests for remaining TerminatorKinds and async, improve Assert Tested and validate results for panic unwind, panic abort, assert!() macro, TerminatorKind::Assert (for example, numeric overflow), and async/await. Implemented a previous documented idea to change Assert handling to be the same as FalseUnwind and Goto, so it doesn't get its own BasicCoverageBlock anymore. This changed a couple of coverage regions, but I validated those changes are not any worse than the prior results, and probably help assure some consistency (even if some people might disagree with how the code region is consistently computed). Fixed issue with async/await. AggregateKind::Generator needs to be handled like AggregateKind::Closure; coverage span for the outer async function should not "cover" the async body, which is actually executed in a separate "closure" MIR. --- .../assert.main.-------.InstrumentCoverage.0.html | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html (limited to 'src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html') diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..499825445ac --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,103 @@ + + + + +assert.main - Coverage Spans + + + +
fn main() -> Result<(),u8> { + let @0⦊mut countdown = 10⦉@0; + while @1,2⦊countdown > 0⦉@1,2 { + if @3,5⦊countdown == 1⦉@3,5 @6,8,9⦊{ + might_fail_assert(3); + }⦉@6,8,9 else if @7⦊countdown < 5⦉@7 @10,12,13⦊{ + might_fail_assert(2); + }⦉@10,12,13@11⦊⦉@11@14⦊⦉@14 + @15,16⦊countdown -= 1⦉@15,16; + } + @4⦊Ok(()) +}⦉@4
+ + -- cgit 1.4.1-3-g733a5