about summary refs log tree commit diff
path: root/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.yield/yield.main-{closure#1}.-------.InstrumentCoverage.0.html
diff options
context:
space:
mode:
authorRich Kadel <richkadel@google.com>2020-11-16 09:14:28 -0800
committerRich Kadel <richkadel@google.com>2020-12-03 09:50:09 -0800
commitc45ee4bb29000cc0d02b11afa682852b5174b8a5 (patch)
tree61e32e64c7145b33632db2f83a941c7550dc6c1a /src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.yield/yield.main-{closure#1}.-------.InstrumentCoverage.0.html
parent1f95c91c887acb2d0c49f549a07025178b818d87 (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.yield/yield.main-{closure#1}.-------.InstrumentCoverage.0.html')
-rw-r--r--src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.yield/yield.main-{closure#1}.-------.InstrumentCoverage.0.html81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.yield/yield.main-{closure#1}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.yield/yield.main-{closure#1}.-------.InstrumentCoverage.0.html
new file mode 100644
index 00000000000..00b2b35f3dd
--- /dev/null
+++ b/src/test/run-make-fulldeps/coverage-spanview-deadcode/expected_mir_dump.yield/yield.main-{closure#1}.-------.InstrumentCoverage.0.html
@@ -0,0 +1,81 @@
+<!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.yield/yield.main-%7Bclosure%231%7D.-------.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>yield.main-{closure#1} - 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 21"><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 even" style="--layer: 1" title="23:9-23:16: @0.Yield: _3 = yield(const 1_i32) -&gt; [resume: bb1, drop: bb6]"><span class="annotation">@0⦊</span>yield 1<span class="annotation">⦉@0</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 odd" style="--layer: 1" title="24:9-24:16: @1.Yield: _4 = yield(const 2_i32) -&gt; [resume: bb2, drop: bb5]"><span class="annotation">@1⦊</span>yield 2<span class="annotation">⦉@1</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="25:9-25:16: @2.Yield: _5 = yield(const 3_i32) -&gt; [resume: bb3, drop: bb4]"><span class="annotation">@2⦊</span>yield 3<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0">;</span></span>
+<span class="line"><span class="code" style="--layer: 0">        return </span><span><span class="code odd" style="--layer: 1" title="26:16-26:21: @3[1]: _0 = const &quot;foo&quot;
+27:6-27:6: @3.Return: return"><span class="annotation">@3⦊</span>"foo"</span></span>
+<span class="line"><span class="code odd" style="--layer: 1" title="26:16-26:21: @3[1]: _0 = const &quot;foo&quot;
+27:6-27:6: @3.Return: return">    }<span class="annotation">⦉@3</span></span></span></span></div>
+</body>
+</html>