()
| 434 | ); |
| 435 | |
| 436 | function 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 | } |
| 461 | TestCoverage( |
| 462 | "test coverage with Ref branch", testCoverageWithRefBranch.toString(), |
| 463 | [{ "start": 0, "end": 6, "count": 1 }, |
nothing calls this directly
no test coverage detected