summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/coverage/off-thread-01.js
blob: ab9172cf92ca133adf269e545f864d2aa16cce8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// |jit-test| --code-coverage; --no-ion; skip-if: helperThreadCount() === 0

assertEq(isLcovEnabled(), true);

offThreadCompileToStencil(`
    let hitCount = 0;
    function offThreadFun() {
        hitCount += 1;
    }

    offThreadFun();
    offThreadFun();
    offThreadFun();
    offThreadFun();
`);
var stencil = finishOffThreadStencil();
evalStencil(stencil);
assertEq(hitCount, 4);

let report = getLcovInfo();

const expected = "FNDA:4,offThreadFun";
assertEq(report.includes(expected), true);