summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/coverage/off-thread-02.js
blob: 18d43f9d0c47940744b7a3f29ab1e78cc26156d2 (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
// |jit-test| --code-coverage; --no-ion; skip-if: helperThreadCount() === 0

assertEq(isLcovEnabled(), true);

offThreadCompileModuleToStencil(`
    globalThis.hitCount = 0;
    function offThreadFun() {
        globalThis.hitCount += 1;
    }

    offThreadFun();
    offThreadFun();
    offThreadFun();
    offThreadFun();
`);
let stencil = finishOffThreadStencil();
let mod = instantiateModuleStencil(stencil);
moduleLink(mod);
moduleEvaluate(mod);
assertEq(hitCount, 4);

const expected = "FNDA:4,offThreadFun";

let report = getLcovInfo();
assertEq(report.includes(expected), true);