MCPcopy Index your code
hub / github.com/nodejs/node / testCoverageWithRefBranch

Function testCoverageWithRefBranch

deps/v8/test/mjsunit/wasm/wasm-code-coverage.js:436–460  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

434);
435
436function testCoverageWithRefBranch() {
437 print(arguments.callee.name);
438 var builder = new WasmModuleBuilder();
439 let array_type_index = builder.addArray(kWasmI32, true);
440
441 builder.addFunction("main", kSig_i_v)
442 .addBody([
443//-------------------------------------------
444 kExprBlock, kWasmVoid, // 1
445 kExprRefNull, array_type_index, // 3
446 kExprBrOnNull, 0, // 5
447//-------------------------------------------
448 ...wasmI32Const(1), // 7
449 kExprReturn, // 9
450//-------------------------------------------
451 kExprEnd, // 10
452//-------------------------------------------
453 ...wasmI32Const(0), // 11
454 ]) // 13
455//-------------------------------------------
456 .exportAs("main");
457
458 instance = builder.instantiate({});
459 assertEquals(0, instance.exports.main());
460}
461TestCoverage(
462 "test coverage with Ref branch", testCoverageWithRefBranch.toString(),
463 [{ "start": 0, "end": 6, "count": 1 },

Callers

nothing calls this directly

Calls 9

addArrayMethod · 0.95
addFunctionMethod · 0.95
instantiateMethod · 0.95
wasmI32ConstFunction · 0.70
printFunction · 0.50
assertEqualsFunction · 0.50
exportAsMethod · 0.45
addBodyMethod · 0.45
mainMethod · 0.45

Tested by

no test coverage detected