summaryrefslogtreecommitdiff
path: root/test/gtest/print-test.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/gtest/print-test.h')
-rw-r--r--test/gtest/print-test.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/gtest/print-test.h b/test/gtest/print-test.h
index 9815c18bb..678896eab 100644
--- a/test/gtest/print-test.h
+++ b/test/gtest/print-test.h
@@ -1,5 +1,6 @@
#include <iostream>
+#include "parser/wat-parser.h"
#include "support/colors.h"
#include "wasm-s-parser.h"
#include "wasm.h"
@@ -19,9 +20,10 @@ protected:
void TearDown() override { Colors::setEnabled(colors); }
void parseWast(wasm::Module& wasm, const std::string& wast) {
- wasm::SExpressionParser parser(wast.c_str());
- wasm::SExpressionWasmBuilder builder(
- wasm, *(*parser.root)[0], wasm::IRProfile::Normal);
+ auto parsed = wasm::WATParser::parseModule(wasm, wast);
+ if (auto* err = parsed.getErr()) {
+ wasm::Fatal() << err->msg << "\n";
+ }
}
};