about summary refs log tree commit diff
path: root/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.j.-------.InstrumentCoverage.0.html
blob: 2b43c7bd25d90bcbf8cf6bc533f69380c06216ab (plain)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!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.-------.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 - 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 48"><span class="line"><span><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)"><span class="annotation">@0,3,4⦊</span>fn j(x: u8) {</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">    // non-async versions of `c()`, `d()`, and `f()` to make it similar to async `i()`.</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">    fn c(x: u8) -&gt; u8 {</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">        if x == 8 {</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">            1 // This line appears covered, but the 1-character expression span covering the `1`</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">              // is not executed. (`llvm-cov show` displays a `^0` below the `1` ). This is because</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">              // `fn j()` executes the open brace for the funciton body, followed by the function's</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">              // first executable statement, `match x`. Inner function declarations are not</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">              // "visible" to the MIR for `j()`, so the code region counts all lines between the</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">              // open brace and the first statement as executed, which is, in a sense, true.</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">              // `llvm-cov show` overcomes this kind of situation by showing the actual counts</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">              // of the enclosed coverages, (that is, the `1` expression was not executed, and</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">              // accurately displays a `0`).</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">        } else {</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">            0</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">        }</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">    }</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">    fn d() -&gt; u8 { 1 }</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">    fn f() -&gt; u8 { 1 }</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="68:11-68:12: @0[0]: FakeRead(ForMatchedPlace, _1)">    match x<span class="annotation">⦉@0,3,4</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="69:9-69:10: @5[3]: _2 = _1"><span class="annotation">@5,7⦊</span>y<span class="annotation">⦉@5,7</span></span></span><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="69:16-69:17: @3[5]: _6 = _1
69:14-69:18: @3.Call: _5 = j::c(move _6) -&gt; [return: bb4, unwind: bb13]
69:22-69:23: @4[3]: _8 = (*_3)
69:22-69:27: @4[4]: _7 = Add(move _8, const 1_u8)
69:14-69:27: @4[6]: _4 = Eq(move _5, move _7)"><span class="annotation">@0,3,4⦊</span>c(x) == y + 1<span class="annotation">⦉@0,3,4</span></span></span><span class="code" style="--layer: 0"> =&gt; </span><span><span class="code odd" style="--layer: 1" title="69:33-69:36: @5.Call: _9 = j::d() -&gt; [return: bb7, unwind: bb13]
69:31-69:39: @7[1]: _0 = const ()"><span class="annotation">@5,7⦊</span>{ d(); }<span class="annotation">⦉@5,7</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="70:9-70:10: @10[3]: _10 = _1"><span class="annotation">@10⦊</span>y<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="70:14-70:17: @8.Call: _13 = j::f() -&gt; [return: bb9, unwind: bb13]
70:21-70:22: @9[2]: _15 = (*_11)
70:21-70:26: @9[3]: _14 = Add(move _15, const 1_u8)
70:14-70:26: @9[5]: _12 = Eq(move _13, move _14)"><span class="annotation">@1,8,9⦊</span>f() == y + 1<span class="annotation">⦉@1,8,9</span></span></span><span class="code" style="--layer: 0"> =&gt; </span><span><span class="code even" style="--layer: 1" title="70:30-70:32: @10[4]: _0 = ()"><span class="annotation">@10⦊</span>()<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0">,</span></span>
<span class="line"><span class="code" style="--layer: 0">        _ =&gt; </span><span><span class="code odd" style="--layer: 1" title="71:14-71:16: @2[0]: _0 = ()"><span class="annotation">@2⦊</span>()<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 even" style="--layer: 1" title="73:2-73:2: @12.Return: return"><span class="annotation">@12⦊</span>‸<span class="annotation">⦉@12</span></span></span></span></div>
</body>
</html>