Index: test/cctest/wasm/test-run-wasm-module.cc |
diff --git a/test/cctest/wasm/test-run-wasm-module.cc b/test/cctest/wasm/test-run-wasm-module.cc |
index 118a91f3e9e33eccc2bb60421dd4858a41589d55..b8c3b66815a3f384e68f893d5e5da8260ccf34d6 100644 |
--- a/test/cctest/wasm/test-run-wasm-module.cc |
+++ b/test/cctest/wasm/test-run-wasm-module.cc |
@@ -193,3 +193,21 @@ TEST(Run_WasmModule_Global) { |
WasmModuleWriter* writer = builder->Build(&zone); |
TestModule(writer->WriteTo(&zone), 97); |
} |
+ |
+TEST(Run_WasmModule_SubDebug) { |
+ v8::base::AccountingAllocator allocator; |
+ Zone zone(&allocator); |
+ WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone); |
+ uint16_t f_index = builder->AddFunction(); |
+ WasmFunctionBuilder* f = builder->FunctionAt(f_index); |
+ f->ReturnType(kAstI32); |
+ f->Exported(1); |
+ uint16_t local = f->AddLocal(kAstI32); |
+ byte code[] = { |
+ WASM_SET_LOCAL(local, WASM_I32V(-1)), |
+ WASM_RETURN(WASM_I32_SUB(WASM_GET_LOCAL(local), WASM_I32V(0)))}; |
+ uint32_t local_indices[] = {1, 11}; |
+ f->EmitCode(code, sizeof(code), local_indices, sizeof(local_indices) / 4); |
+ WasmModuleWriter* writer = builder->Build(&zone); |
+ TestModule(writer->WriteTo(&zone), -1); |
+} |