diff options
| author | Rich Kadel <richkadel@google.com> | 2020-11-16 09:14:28 -0800 |
|---|---|---|
| committer | Rich Kadel <richkadel@google.com> | 2020-12-03 09:50:09 -0800 |
| commit | c45ee4bb29000cc0d02b11afa682852b5174b8a5 (patch) | |
| tree | 61e32e64c7145b33632db2f83a941c7550dc6c1a /src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html | |
| parent | 1f95c91c887acb2d0c49f549a07025178b818d87 (diff) | |
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.
Diffstat (limited to 'src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html')
| -rw-r--r-- | src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html | 103 |
1 files changed, 103 insertions, 0 deletions
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 @@ +<!DOCTYPE html> +<!-- + +Preview this file as rendered HTML from the github source at: +https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview-base/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html + +For revisions in Pull Requests (PR): + * Replace "rust-lang" with the github PR author + * Replace "master" with the PR branch name + +--> +<html> +<head> +<title>assert.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 8"><span class="line"><span class="code" style="--layer: 0">fn main() -> Result<(),u8> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="10:25-10:27: @0[1]: _1 = const 10_i32 +10:9-10:22: @0[2]: FakeRead(ForLet, _1)"><span class="annotation">@0⦊</span>mut countdown = 10<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> while </span><span><span class="code odd" style="--layer: 1" title="11:11-11:20: @2[2]: _5 = _1 +11:11-11:24: @2[3]: _4 = Gt(move _5, const 0_i32) +11:11-11:24: @2[5]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@1,2⦊</span>countdown > 0<span class="annotation">⦉@1,2</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="12:12-12:21: @5[3]: _8 = _1 +12:12-12:26: @5[4]: _7 = Eq(move _8, const 1_i32) +12:12-12:26: @5[6]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@3,5⦊</span>countdown == 1<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="13:13-13:33: @8.Call: _9 = might_fail_assert(const 3_u32) -> [return: bb9, unwind: bb17] +12:27-14:10: @9[1]: _6 = const ()"><span class="annotation">@6,8,9⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:13-13:33: @8.Call: _9 = might_fail_assert(const 3_u32) -> [return: bb9, unwind: bb17] +12:27-14:10: @9[1]: _6 = const ()"> might_fail_assert(3);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:13-13:33: @8.Call: _9 = might_fail_assert(const 3_u32) -> [return: bb9, unwind: bb17] +12:27-14:10: @9[1]: _6 = const ()"> }<span class="annotation">⦉@6,8,9</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code even" style="--layer: 1" title="14:19-14:28: @7[2]: _11 = _1 +14:19-14:32: @7[3]: _10 = Lt(move _11, const 5_i32) +14:19-14:32: @7[5]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@7⦊</span>countdown < 5<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="15:13-15:33: @12.Call: _12 = might_fail_assert(const 2_u32) -> [return: bb13, unwind: bb17] +14:33-16:10: @13[1]: _6 = const ()"><span class="annotation">@10,12,13⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="15:13-15:33: @12.Call: _12 = might_fail_assert(const 2_u32) -> [return: bb13, unwind: bb17] +14:33-16:10: @13[1]: _6 = const ()"> might_fail_assert(2);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="15:13-15:33: @12.Call: _12 = might_fail_assert(const 2_u32) -> [return: bb13, unwind: bb17] +14:33-16:10: @13[1]: _6 = const ()"> }<span class="annotation">⦉@10,12,13</span></span></span><span><span class="code even" style="--layer: 1" title="16:10-16:10: @11.Goto: goto -> bb14"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span><span><span class="code odd" style="--layer: 1" title="16:10-16:10: @14.Goto: goto -> bb15"><span class="annotation">@14⦊</span>‸<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="17:9-17:23: @15[2]: _13 = CheckedSub(_1, const 1_i32) +17:9-17:23: @16[0]: _1 = move (_13.0: i32)"><span class="annotation">@15,16⦊</span>countdown -= 1<span class="annotation">⦉@15,16</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="19:8-19:10: @4[4]: _15 = () +19:5-19:11: @4[5]: _0 = std::result::Result::<(), u8>::Ok(move _15) +20:2-20:2: @4.Return: return"><span class="annotation">@4⦊</span>Ok(())</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="19:8-19:10: @4[4]: _15 = () +19:5-19:11: @4[5]: _0 = std::result::Result::<(), u8>::Ok(move _15) +20:2-20:2: @4.Return: return">}<span class="annotation">⦉@4</span></span></span></span></div> +</body> +</html> |
