From d4d55f9c45740df17f9fc2896e54378c2561d58a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 6 Jul 2016 11:26:10 -0700 Subject: print line numbers when running tests in shell --- src/tools/binaryen-shell.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/binaryen-shell.cpp b/src/tools/binaryen-shell.cpp index 8e6622de3..79c01c5bf 100644 --- a/src/tools/binaryen-shell.cpp +++ b/src/tools/binaryen-shell.cpp @@ -105,7 +105,10 @@ static void run_asserts(size_t* i, bool* checked, Module* wasm, Colors::green(std::cerr); std::cerr << " CHECKING: "; Colors::normal(std::cerr); - std::cerr << curr << '\n'; + std::cerr << curr; + Colors::green(std::cerr); + std::cerr << " [line: " << curr.line << "]\n"; + Colors::normal(std::cerr); if (id == ASSERT_INVALID) { // a module invalidity test Module wasm; -- cgit v1.2.3 From 5287706104bc07394e64bd73b1e1ddbc06b957b5 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 6 Jul 2016 11:44:00 -0700 Subject: fix parsing of large ints --- src/parsing.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/parsing.h b/src/parsing.h index f5df77bad..fb9e3547c 100644 --- a/src/parsing.h +++ b/src/parsing.h @@ -127,7 +127,7 @@ inline Expression* parseConst(cashew::IString s, WasmType type, MixedArena& allo ret->value = Literal(negative ? -temp : temp); } else { std::istringstream istr(str); - int32_t temp; + uint32_t temp; istr >> temp; ret->value = Literal(temp); } @@ -143,7 +143,7 @@ inline Expression* parseConst(cashew::IString s, WasmType type, MixedArena& allo ret->value = Literal(negative ? -temp : temp); } else { std::istringstream istr(str); - int64_t temp; + uint64_t temp; istr >> temp; ret->value = Literal(temp); } -- cgit v1.2.3 From fa050b2f9c1e4b68c5067487515d1f67ae9bf9cf Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 24 Jun 2016 09:42:52 -0700 Subject: update spec tests, and handle some flux in call_indirect in upstream --- check.py | 2 +- src/wasm-binary.h | 1 + src/wasm-s-parser.h | 8 ++++++++ test/spec | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/check.py b/check.py index 214ade67b..622989006 100755 --- a/check.py +++ b/check.py @@ -453,7 +453,7 @@ for t in spec_tests: # check binary format. here we can verify execution of the final result, no need for an output verification split_num = 0 - if os.path.basename(wast) not in ['has_feature.wast']: # avoid some tests with things still in spec tests, but likely to be taken out soon + if os.path.basename(wast) not in ['call_indirect.wast']: # avoid some tests with things still being sorted out in the spec https://github.com/WebAssembly/spec/pull/301 actual = '' for module, asserts in split_wast(wast): print ' testing split module', split_num diff --git a/src/wasm-binary.h b/src/wasm-binary.h index a76bf7fa5..e77f3992e 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -469,6 +469,7 @@ class WasmBinaryWriter : public Visitor { if (func->type.isNull()) { func->type = ensureFunctionType(getSig(func.get()), wasm)->name; } + // TODO: depending on upstream flux https://github.com/WebAssembly/spec/pull/301 might want this: assert(!func->type.isNull()); } } diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index a48ee1a5f..c6b3809f1 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -498,6 +498,14 @@ private: body = allocator.alloc(); } if (currFunction->result != result) throw ParseException("bad func declaration", s.line, s.col); + /* TODO: spec in flux, https://github.com/WebAssembly/spec/pull/301 + if (type.isNull()) { + // if no function type provided, generate a private one for this function + auto* functionType = sigToFunctionType(getSig(currFunction.get())); + wasm.addFunctionType(functionType); + type = functionType->name; + } + */ currFunction->body = body; currFunction->type = type; wasm.addFunction(currFunction.release()); diff --git a/test/spec b/test/spec index 1928ef280..88274ef43 160000 --- a/test/spec +++ b/test/spec @@ -1 +1 @@ -Subproject commit 1928ef28031e7041a4b2a9ae0e7dda8a8c578d29 +Subproject commit 88274ef4376b5a679a2cd0a1d630bf7e71f96cf9 -- cgit v1.2.3