1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
<!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/expected_mir_dump.async/async.j-c.-------.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>async.j-c - 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 50"><span class="line"> <span><span class="code even" style="--layer: 1" title="52:12-52:13: @0[2]: _3 = _1
52:12-52:18: @0[3]: _2 = Eq(move _3, const 8_u8)"><span class="annotation">@0⦊</span>fn c(x: u8) -> u8 {</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="52:12-52:13: @0[2]: _3 = _1
52:12-52:18: @0[3]: _2 = Eq(move _3, const 8_u8)"> if x == 8<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="53:13-53:14: @1[0]: _0 = const 1_u8"><span class="annotation">@1⦊</span>1<span class="annotation">⦉@1</span></span></span><span class="code" style="--layer: 0"> // This line appears covered, but the 1-character expression span covering the `1`</span></span>
<span class="line"><span class="code" style="--layer: 0"> // is not executed. (`llvm-cov show` displays a `^0` below the `1` ). This is because</span></span>
<span class="line"><span class="code" style="--layer: 0"> // `fn j()` executes the open brace for the funciton body, followed by the function's</span></span>
<span class="line"><span class="code" style="--layer: 0"> // first executable statement, `match x`. Inner function declarations are not</span></span>
<span class="line"><span class="code" style="--layer: 0"> // "visible" to the MIR for `j()`, so the code region counts all lines between the</span></span>
<span class="line"><span class="code" style="--layer: 0"> // open brace and the first statement as executed, which is, in a sense, true.</span></span>
<span class="line"><span class="code" style="--layer: 0"> // `llvm-cov show` overcomes this kind of situation by showing the actual counts</span></span>
<span class="line"><span class="code" style="--layer: 0"> // of the enclosed coverages, (that is, the `1` expression was not executed, and</span></span>
<span class="line"><span class="code" style="--layer: 0"> // accurately displays a `0`).</span></span>
<span class="line"><span class="code" style="--layer: 0"> } else {</span></span>
<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="63:13-63:14: @2[0]: _0 = const 0_u8"><span class="annotation">@2⦊</span>0<span class="annotation">⦉@2</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="65:6-65:6: @3.Return: return"><span class="annotation">@3⦊</span>‸<span class="annotation">⦉@3</span></span></span></span></div>
</body>
</html>
|